Skip to content

Print the dotnet getting started guide (#195) #528

Print the dotnet getting started guide (#195)

Print the dotnet getting started guide (#195) #528

Workflow file for this run

name: CI
on:
push:
# Avoid duplicate builds on PRs.
branches:
- main
pull_request:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
lint:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Rust toolchain
run: rustup update
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Clippy
run: cargo clippy --all-targets --locked -- --deny warnings
- name: rustfmt
run: cargo fmt -- --check
unit-test:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Rust toolchain
run: rustup update
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Run unit tests
run: cargo test --locked
integration-test:
strategy:
fail-fast: false
matrix:
arch: ["amd64", "arm64"]
runs-on: ${{ matrix.arch == 'arm64' && 'pub-hk-ubuntu-24.04-arm-medium' || 'ubuntu-24.04' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install musl-tools
run: sudo apt-get install -y --no-install-recommends musl-tools
- name: Update Rust toolchain
run: rustup update
- name: Install Rust linux-musl target
run: rustup target add ${{ matrix.arch == 'arm64' && 'aarch64-unknown-linux-musl' || 'x86_64-unknown-linux-musl' }}
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Install Pack CLI
uses: buildpacks/github-actions/[email protected]
# The images are pulled up front to prevent duplicate pulls due to the tests being run concurrently.
- name: Pull builder image
run: docker pull heroku/builder:24
- name: Pull run image
run: docker pull heroku/heroku:24
# The integration tests are annotated with the `ignore` attribute, allowing us to run
# only those and not the unit tests, via the `--ignored` option. On the latest stack
# we run all integration tests, but on older stacks we only run stack-specific tests.
- name: Run integration tests (all tests)
run: cargo test --locked -- --ignored --test-threads 10
print-output:
runs-on: 'pub-hk-ubuntu-24.04-arm-medium'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install musl-tools
run: sudo apt-get install -y --no-install-recommends musl-tools
- name: Update Rust toolchain
run: rustup update
- name: Install Rust linux-musl target
run: rustup target add aarch64-unknown-linux-musl
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Install Pack CLI
uses: buildpacks/github-actions/[email protected]
- name: Clone getting started guide
uses: actions/checkout@v4
with:
repository: heroku/dotnet-getting-started
path: tmp/guide
# The images are pulled up front to prevent duplicate pulls due to the tests being run concurrently.
- name: Pull builder image
run: docker pull heroku/builder:24
- name: Pull run image
run: docker pull heroku/heroku:24
- name: Install libcnb-cargo for `cargo libcnb package` command
run: cargo install libcnb-cargo
- name: Compile buildpack
run: cargo libcnb package --target aarch64-unknown-linux-musl
- name: "PRINT: Getting started guide output"
run: pack build my-image --force-color --builder heroku/builder:24 --trust-extra-buildpacks --buildpack packaged/aarch64-unknown-linux-musl/debug/heroku_dotnet --path tmp/guide --pull-policy never
- name: "PRINT: Cached getting started guide output"
run: pack build my-image --force-color --builder heroku/builder:24 --trust-extra-buildpacks --buildpack packaged/aarch64-unknown-linux-musl/debug/heroku_dotnet --path tmp/guide --pull-policy never