Add the internal collection window #7
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: CI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| merge_group: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # fmt and clippy run on the dev toolchain, auto-installed by rustup from | |
| # rust-toolchain.toml. Only the test matrix pins explicit versions. | |
| fmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - run: cargo fmt --all --check | |
| clippy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo clippy --all-targets --all-features -- -D warnings | |
| test: | |
| needs: [fmt, clippy] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # "stable" and "beta" track the moving channels; beta is allowed to | |
| # fail, see continue-on-error below. 1.95 is the dev version from | |
| # rust-toolchain.toml, 1.93 is the MSRV (rust-version in Cargo.toml). | |
| # Raise these pins, rust-toolchain.toml and rust-version together by hand. | |
| rust: ["stable", "beta", "1.95", "1.93"] | |
| env: | |
| - name: ubuntu | |
| container: "" | |
| - name: arch | |
| container: "archlinux:latest" | |
| name: test (${{ matrix.env.name }} / ${{ matrix.rust }}) | |
| runs-on: ubuntu-latest | |
| # beta tracks the upcoming release; an upstream regression there must not | |
| # block the merge queue. ci-success counts a continued job as success. | |
| continue-on-error: ${{ matrix.rust == 'beta' }} | |
| container: ${{ matrix.env.container }} | |
| env: | |
| RUSTUP_TOOLCHAIN: ${{ matrix.rust }} | |
| steps: | |
| # Distro containers ship no compiler/linker; install the minimum. carpool | |
| # has no C or TLS deps, so no openssl or pkg-config is needed here. | |
| - name: Prep (arch) | |
| if: matrix.env.name == 'arch' | |
| run: | | |
| pacman -Syu --noconfirm git curl base-devel | |
| - uses: actions/checkout@v6 | |
| # Explicit per-version install: RUSTUP_TOOLCHAIN overrides | |
| # rust-toolchain.toml, and the distro containers have no preinstalled Rust. | |
| - uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master, pinned 2026-03-27 | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: ${{ matrix.env.name }}-${{ matrix.rust }} | |
| # Build the core alone (no-default-features), then run the suite with all | |
| # features. Both on every toolchain, so the MSRV row builds the core under | |
| # 1.93 rather than only the all-features test pass. | |
| - run: cargo build --no-default-features | |
| - run: cargo test --all-features | |
| # Single stable status check for branch protection / merge queue. Matrix job | |
| # names shift when the version list changes; this gate name does not. | |
| ci-success: | |
| name: CI success | |
| if: ${{ always() }} | |
| needs: [fmt, clippy, test] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check job results | |
| run: | | |
| for r in "${{ needs.fmt.result }}" "${{ needs.clippy.result }}" \ | |
| "${{ needs.test.result }}"; do | |
| case "$r" in | |
| success | skipped) ;; | |
| *) echo "required job result: $r"; exit 1 ;; | |
| esac | |
| done | |
| echo "all required jobs succeeded or were skipped" |