Merge pull request #2 from SecurityRonin/ci/fix-deny-gate-native #20
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: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| rust: [stable, "1.70"] | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # master | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2 | |
| # MSRV job: test lib only (no clap, which requires newer rustc) | |
| - name: Test lib (no default features) | |
| if: matrix.rust != 'stable' | |
| run: cargo test --no-default-features --lib | |
| - name: Test lib (default features) | |
| if: matrix.rust == 'stable' | |
| run: cargo test --lib | |
| - name: Test lib (fs feature) | |
| if: matrix.rust == 'stable' | |
| run: cargo test --features fs --lib | |
| - name: Doc-tests | |
| if: matrix.rust == 'stable' | |
| run: cargo test --doc | |
| clippy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # master | |
| with: | |
| toolchain: stable | |
| components: clippy | |
| - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2 | |
| - run: cargo clippy --all-targets -- -D warnings | |
| - run: cargo clippy --all-targets --features fs -- -D warnings | |
| fmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # master | |
| with: | |
| toolchain: stable | |
| components: rustfmt | |
| - run: cargo fmt --check | |
| deny: | |
| name: Cargo Deny (advisories/licenses/bans/sources) | |
| runs-on: ubuntu-latest | |
| # Native install rather than the Docker-based cargo-deny-action: the action | |
| # builds a container from a Docker Hub base image at runtime, which is rate- | |
| # limited/flaky from GitHub Actions and made this gate red on a transient | |
| # registry timeout. Mirrors the `vet` job below (taiki-e/install-action). | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Install cargo-deny | |
| uses: taiki-e/install-action@59012be0884e296ca2da49b530610e72c49039ad # v2.81.6 | |
| with: | |
| tool: cargo-deny | |
| - name: Check dependency hygiene | |
| run: cargo deny check | |
| vet: | |
| name: Cargo Vet (supply-chain) | |
| runs-on: ubuntu-latest | |
| # Complements `deny` (known-bad advisories/licenses) with the supply-chain- | |
| # injection layer: every dependency version must be human-source-reviewed or | |
| # covered by an imported aggregate audit set (Google/Mozilla/Bytecode-Alliance/ | |
| # Embark). Config in supply-chain/{config,audits,imports}.toml. | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Install cargo-vet | |
| uses: taiki-e/install-action@59012be0884e296ca2da49b530610e72c49039ad # v2.81.6 | |
| with: | |
| tool: cargo-vet | |
| - name: Fetch dependencies | |
| run: cargo fetch | |
| - name: Check supply chain | |
| run: cargo vet --locked |