Use the shared GitHub Actions workflows for buildpack releases (#58) #251
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- 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-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Update Rust toolchain | |
run: rustup update | |
- name: Rust Cache | |
uses: Swatinem/[email protected] | |
- name: Run unit tests | |
run: cargo test --locked | |
integration-test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
builder: ["builder:22", "buildpacks:20"] | |
env: | |
INTEGRATION_TEST_CNB_BUILDER: heroku/${{ matrix.builder }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install musl-tools | |
run: sudo apt-get install musl-tools --no-install-recommends | |
- name: Update Rust toolchain | |
run: rustup update | |
- name: Install Rust linux-musl target | |
run: rustup target add x86_64-unknown-linux-musl | |
- name: Rust Cache | |
uses: Swatinem/[email protected] | |
- name: Install Pack CLI | |
uses: buildpacks/github-actions/[email protected] | |
- name: Pull builder image | |
run: docker pull ${{ env.INTEGRATION_TEST_CNB_BUILDER }} | |
# 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) | |
if: matrix.builder == 'builder:22' | |
run: cargo test --locked -- --ignored --test-threads 5 | |
- name: Run integration tests (stack-specific tests only) | |
if: matrix.builder != 'builder:22' | |
run: cargo test --locked -- --ignored --test-threads 5 'python_version::' |