ci: Enable merge queue support #75
This file contains hidden or 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: Rust | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| merge_group: | |
| permissions: | |
| contents: read | |
| # don't waste job slots on superseded code | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| semver-checks: | |
| name: Semver Checks | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: obi1kenobi/cargo-semver-checks-action@v2 | |
| with: | |
| # Pinned until cargo-semver-checks supports rustdoc format v57 (Rust 1.93+) | |
| rust-toolchain: "1.92.0" | |
| build-test-lint: | |
| name: Build, Test & Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Rust | |
| uses: bootc-dev/actions/setup-rust@main | |
| - name: Install tools | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: just | |
| - name: Install rustfmt and clippy | |
| run: rustup component add rustfmt clippy | |
| - name: just ci | |
| run: just ci | |
| required-checks: | |
| if: always() | |
| needs: [semver-checks, build-test-lint] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check all jobs | |
| env: | |
| NEEDS: ${{ toJson(needs) }} | |
| run: | | |
| FAILED=$(echo "$NEEDS" | jq -r 'to_entries[] | select(.value.result | IN("success","skipped") | not) | .key') | |
| if [ -n "$FAILED" ]; then | |
| echo "The following jobs did not succeed: $FAILED" | |
| exit 1 | |
| fi | |
| echo "All jobs succeeded or were skipped." |