Fix minimal-versions CI by constraining transitive dependencies #36
Workflow file for this run
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, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| rust: | |
| - stable | |
| - beta | |
| - nightly | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| components: rustfmt, clippy | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| # - name: Check formatting | |
| # if: matrix.rust == 'stable' | |
| # run: cargo fmt --all -- --check | |
| - name: Run clippy | |
| if: matrix.rust == 'stable' | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| - name: Run rust-guardian self-assessment | |
| if: matrix.rust == 'stable' | |
| run: | | |
| # Build first to ensure rust-guardian binary is available | |
| cargo build --release | |
| # Run rust-guardian on its own source code | |
| cargo run --release -- check src/ --config guardian.yaml --format github | |
| - name: Build | |
| run: cargo build --verbose --all-features | |
| - name: Run tests | |
| run: cargo test --verbose --all-features | |
| - name: Test CLI | |
| run: | | |
| cargo run -- --help | |
| cargo run -- check --help | |
| cargo run -- rules | |
| coverage: | |
| name: Coverage | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install cargo-llvm-cov | |
| uses: taiki-e/install-action@cargo-llvm-cov | |
| - name: Generate code coverage | |
| run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: lcov.info | |
| fail_ci_if_error: true | |
| security: | |
| name: Security Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install cargo-audit | |
| run: cargo install cargo-audit | |
| - name: Run security audit | |
| run: cargo audit | |
| minimal-versions: | |
| name: Minimal Versions | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@nightly | |
| - name: Install minimal-versions | |
| run: | | |
| cargo install cargo-minimal-versions | |
| cargo install cargo-hack | |
| - name: Check minimal versions | |
| run: cargo minimal-versions check |