on: push: branches: ["main"] pull_request: permissions: contents: read env: RUST_MSRV: 1.95.0 CARGO_INCREMENTAL: 0 CARGO_PROFILE_TEST_DEBUG: 0 CARGO_LLVM_COV_VERSION: 0.6.20 CARGO_NEXTEST_VERSION: 0.9.114 jobs: rustfmt-msrv: name: Check rustfmt formatting on MSRV runs-on: ubuntu-24.04 steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Fetch MSRV run: | rustup toolchain install ${RUST_MSRV}-x86_64-unknown-linux-gnu rustup override set ${RUST_MSRV}-x86_64-unknown-linux-gnu - name: Run rustfmt run: | rustup component add rustfmt cargo fmt --check --all clippy-msrv: name: Check Clippy lints on MSRV runs-on: ubuntu-24.04 steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Fetch MSRV run: | rustup toolchain install ${RUST_MSRV}-x86_64-unknown-linux-gnu rustup override set ${RUST_MSRV}-x86_64-unknown-linux-gnu - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 - name: Run Clippy run: | rustup component add clippy cargo clippy --all-targets -- -D warnings build-msrv-default-features: name: Build on MSRV (default features) runs-on: ubuntu-24.04 steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Fetch MSRV run: | rustup toolchain install ${RUST_MSRV}-x86_64-unknown-linux-gnu rustup override set ${RUST_MSRV}-x86_64-unknown-linux-gnu - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 - name: Build run: | cargo build --locked build-msrv-no-default-features: name: Build on MSRV (no default features) runs-on: ubuntu-24.04 steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Fetch MSRV run: | rustup toolchain install ${RUST_MSRV}-x86_64-unknown-linux-gnu rustup override set ${RUST_MSRV}-x86_64-unknown-linux-gnu - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 - name: Build run: | cargo build --locked --no-default-features tests-nightly: name: Run tests on nightly (${{ matrix.runner }}) strategy: fail-fast: false matrix: include: - runner: ubuntu-24.04-arm target: aarch64-unknown-linux-gnu - runner: macos-26 target: aarch64-apple-darwin - runner: windows-latest target: x86_64-pc-windows-msvc runs-on: ${{ matrix.runner }} steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Install cargo-nextest uses: taiki-e/install-action@c93ccc03e00cd0e08e494f5fd058a6c55a6a1907 # v2.82.8 with: tool: cargo-nextest@${{ env.CARGO_NEXTEST_VERSION }} - name: Fetch nightly Rust run: | rustup toolchain install nightly-${{ matrix.target }} rustup override set nightly-${{ matrix.target }} - name: Install lld on macOS if: matrix.target == 'x86_64-apple-darwin' || matrix.target == 'aarch64-apple-darwin' run: | brew install lld - name: Test env: RUSTFLAGS: -A dead_code -A unused_variables run: | cargo nextest run --no-fail-fast --verbose --locked coverage-nightly: name: Test coverage on nightly (ubuntu-24.04) runs-on: ubuntu-24.04 steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Install cargo-llvm-cov and cargo-nextest uses: taiki-e/install-action@c93ccc03e00cd0e08e494f5fd058a6c55a6a1907 # v2.82.8 with: tool: cargo-llvm-cov@${{ env.CARGO_LLVM_COV_VERSION }},cargo-nextest@${{ env.CARGO_NEXTEST_VERSION }} - name: Fetch nightly Rust run: | rustup toolchain install nightly-x86_64-unknown-linux-gnu rustup override set nightly-x86_64-unknown-linux-gnu - name: Test with coverage env: RUSTFLAGS: -A dead_code -A unused_variables run: | cargo llvm-cov nextest --no-fail-fast --verbose --codecov --locked --output-path codecov.json - name: Upload coverage reports to Codecov uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 with: files: ./codecov.json token: ${{ secrets.CODECOV_TOKEN }}