ci: prebuilt tool install + drop redundant build steps #37
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: | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| check: | |
| name: Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # stable | |
| with: | |
| toolchain: stable | |
| components: rustfmt, clippy | |
| - uses: Swatinem/rust-cache@23869a5bd66c73db3c0ac40331f3206eb23791dc # v2.9.1 | |
| # Prebuilt binaries for tooling instead of `cargo install …` from | |
| # source — saves ~3 min per run. Falls back to cargo install if a | |
| # tool doesn't publish prebuilts. | |
| - uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-audit,rustqual | |
| - name: Format check | |
| run: cargo fmt --check | |
| - name: Clippy | |
| run: cargo clippy --all-targets | |
| env: | |
| RUSTFLAGS: "-Dwarnings" | |
| - name: Clippy (candle) | |
| run: cargo clippy --all-targets --features candle | |
| env: | |
| RUSTFLAGS: "-Dwarnings" | |
| # `cargo test` compiles as part of running — no separate build step | |
| # needed. Clippy above already validates that the crate type-checks. | |
| - name: Test | |
| run: cargo test | |
| - name: Test (candle) | |
| run: cargo test --features candle | |
| - name: Security audit | |
| run: cargo audit | |
| - name: Quality analysis | |
| # Scan the whole repository (src/, tests/, benches/, examples/) | |
| # so that test-code quality issues are not silently ignored. | |
| run: rustqual . --fail-on-warnings |