CI #4167
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 | |
| permissions: {} | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: '0 2 * * *' | |
| workflow_dispatch: | |
| env: | |
| CARGO_INCREMENTAL: 0 | |
| CARGO_NET_GIT_FETCH_WITH_CLI: true | |
| CARGO_NET_RETRY: 10 | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| RUSTDOCFLAGS: -D warnings | |
| RUSTFLAGS: -D warnings | |
| RUSTUP_MAX_RETRIES: 10 | |
| defaults: | |
| run: | |
| shell: bash --noprofile --norc -CeEuxo pipefail {0} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| jobs: | |
| check-external-types: | |
| uses: taiki-e/github-actions/.github/workflows/rust-check-external-types.yml@e6a1170cbd07eb898017958967912976fce18f2d # 2026.7.3 | |
| clippy: | |
| uses: taiki-e/github-actions/.github/workflows/rust-clippy.yml@e6a1170cbd07eb898017958967912976fce18f2d # 2026.7.3 | |
| with: | |
| implicit_provenance_casts: false # TODO | |
| docs: | |
| uses: taiki-e/github-actions/.github/workflows/rust-docs.yml@e6a1170cbd07eb898017958967912976fce18f2d # 2026.7.3 | |
| # Test crates on their minimum Rust versions and nightly Rust. | |
| test: | |
| env: | |
| RUST_VERSION: ${{ matrix.rust }} | |
| RUST_TARGET: ${{ matrix.target }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - rust: '1.74' | |
| os: ubuntu-latest | |
| - rust: '1.74' | |
| os: ubuntu-24.04-arm | |
| - rust: '1.74' | |
| os: windows-latest | |
| - rust: stable | |
| os: ubuntu-latest | |
| - rust: stable | |
| os: ubuntu-24.04-arm | |
| - rust: stable | |
| os: windows-latest | |
| - rust: nightly | |
| os: ubuntu-latest | |
| - rust: nightly | |
| os: ubuntu-24.04-arm | |
| - rust: nightly | |
| os: macos-latest | |
| - rust: nightly | |
| os: windows-latest | |
| - rust: nightly | |
| os: windows-11-arm | |
| - rust: nightly | |
| os: ubuntu-latest | |
| target: i686-unknown-linux-gnu | |
| - rust: nightly | |
| os: ubuntu-24.04-arm | |
| target: armv7-unknown-linux-gnueabihf | |
| - rust: nightly | |
| os: ubuntu-latest | |
| target: powerpc64le-unknown-linux-gnu | |
| - rust: nightly | |
| os: ubuntu-latest | |
| target: s390x-unknown-linux-gnu | |
| # # Test 32-bit target that does not have AtomicU64/AtomicI64. | |
| # - rust: nightly | |
| # os: ubuntu-24.04-arm | |
| # container: debian:13-slim | |
| # target: armv5te-unknown-linux-gnueabi | |
| # Test target without stable inline asm support. | |
| - rust: stable | |
| os: ubuntu-latest | |
| target: sparc64-unknown-linux-gnu | |
| runs-on: ${{ matrix.os }} | |
| container: ${{ matrix.container && fromJSON(format('{{"image":"{0}","options":"--privileged"}}', matrix.container)) || '' }} | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 | |
| - run: apt-get -o Acquire::Retries=10 -qq update && apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends gcc libc6-dev | |
| if: matrix.container != '' | |
| - name: Install Rust | |
| uses: taiki-e/install-action@07b4745e0c39a41822af610387492e3e53aa222b # v2.83.4 | |
| with: | |
| tool: rust@${{ matrix.rust }} | |
| fallback: none | |
| - uses: taiki-e/setup-cross-toolchain-action@3d9770ce98eb7dbcf378563182a5e8031165f75b # v1.41.0 | |
| with: | |
| target: ${{ matrix.target }} | |
| runner: ${{ matrix.container && 'native' || '' }} | |
| if: matrix.target != '' | |
| - run: | | |
| echo "RUSTFLAGS=${RUSTFLAGS} --cfg gha_macos_runner" >>"${GITHUB_ENV}" | |
| echo "RUSTDOCFLAGS=${RUSTDOCFLAGS} --cfg gha_macos_runner" >>"${GITHUB_ENV}" | |
| if: startsWith(matrix.os, 'macos') | |
| - name: Test | |
| run: ci/test.sh | |
| # Check all feature combinations works properly. | |
| features: | |
| env: | |
| RUST_VERSION: ${{ matrix.rust }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| rust: | |
| - msrv | |
| - nightly | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 | |
| - name: Install Rust | |
| uses: taiki-e/install-action@07b4745e0c39a41822af610387492e3e53aa222b # v2.83.4 | |
| with: | |
| tool: rust@${{ matrix.rust }} | |
| fallback: none | |
| if: matrix.rust != 'msrv' | |
| - name: Install cargo-hack | |
| uses: taiki-e/install-action@07b4745e0c39a41822af610387492e3e53aa222b # v2.83.4 | |
| with: | |
| tool: cargo-hack | |
| fallback: none | |
| - name: Check features | |
| run: ci/check-features.sh | |
| # Check for duplicate dependencies. | |
| dependencies: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 | |
| - name: Install Rust, cargo-hack, and cargo-minimal-versions | |
| uses: taiki-e/install-action@07b4745e0c39a41822af610387492e3e53aa222b # v2.83.4 | |
| with: | |
| tool: rust@nightly,cargo-hack,cargo-minimal-versions | |
| fallback: none | |
| - name: dependency tree check | |
| run: ci/dependencies.sh | |
| # Run miri. | |
| miri: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| group: | |
| - channel | |
| - others | |
| miriflags: | |
| - '' | |
| - '-Zmiri-tree-borrows' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 | |
| - name: Install Rust | |
| uses: taiki-e/install-action@07b4745e0c39a41822af610387492e3e53aa222b # v2.83.4 | |
| with: | |
| tool: rust@nightly+miri | |
| fallback: none | |
| - name: miri | |
| run: ci/miri.sh "${GROUP}" | |
| env: | |
| MIRIFLAGS: ${{ matrix.miriflags }} | |
| GROUP: ${{ matrix.group }} | |
| # Run cargo-careful. | |
| careful: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 | |
| - name: Install Rust and cargo-careful | |
| uses: taiki-e/install-action@07b4745e0c39a41822af610387492e3e53aa222b # v2.83.4 | |
| with: | |
| tool: rust@nightly+rust-src,cargo-careful | |
| fallback: none | |
| - name: Run cargo-careful | |
| run: ci/careful.sh | |
| # Run sanitizers. | |
| san: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 | |
| - name: Install Rust | |
| uses: taiki-e/install-action@07b4745e0c39a41822af610387492e3e53aa222b # v2.83.4 | |
| with: | |
| tool: rust@nightly+rust-src+x86_64-unknown-linux-gnuasan+x86_64-unknown-linux-gnutsan+x86_64-unknown-linux-gnumsan | |
| fallback: none | |
| - name: Run sanitizers | |
| run: ci/san.sh | |
| # Run loom tests. | |
| loom: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 | |
| - name: Install Rust | |
| uses: taiki-e/install-action@07b4745e0c39a41822af610387492e3e53aa222b # v2.83.4 | |
| with: | |
| tool: rust@stable | |
| fallback: none | |
| - name: loom | |
| run: ci/crossbeam-epoch-loom.sh | |
| tidy: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 | |
| - name: Install Rust, shfmt, shellcheck, taplo, and zizmor | |
| uses: taiki-e/install-action@07b4745e0c39a41822af610387492e3e53aa222b # v2.83.4 | |
| with: | |
| tool: rust@nightly+rustfmt,shfmt,shellcheck,taplo,zizmor | |
| fallback: none | |
| # `cargo fmt` cannot recognize files not included in the current workspace and modules | |
| # defined inside macros, so run rustfmt directly. | |
| # We need to use nightly rustfmt because we use the unstable formatting options of rustfmt. | |
| - run: rustfmt --check $(git ls-files '*.rs') | |
| - run: shfmt -d $(git ls-files '*.sh') | |
| - run: RUST_LOG=warn taplo fmt --check $(git ls-files '*.toml') | |
| - run: shellcheck $(git ls-files '*.sh') | |
| - run: zizmor . -q --strict-collection --persona=auditor | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |