feat: add anti-track / anti-upgrade module #85
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] | |
| pull_request: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTFLAGS: -Dwarnings | |
| # Disable incremental compilation on CI: unused by fresh builds and | |
| # wastes cache space. See https://matklad.github.io/2021/09/04/fast-rust-builds.html | |
| CARGO_INCREMENTAL: 0 | |
| # Use git CLI for cargo fetches β more reliable on Windows than libgit2. | |
| CARGO_NET_GIT_FETCH_WITH_CLI: true | |
| # Shrink debuginfo to speed compile + cache. Tests still run fine. | |
| CARGO_PROFILE_DEV_DEBUG: "line-tables-only" | |
| CARGO_PROFILE_TEST_DEBUG: "line-tables-only" | |
| jobs: | |
| check: | |
| name: Check & Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| components: rustfmt, clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| # Share cache between check & test on ubuntu β same toolchain | |
| # + Cargo.lock β same dependency graph, so this is safe and | |
| # roughly halves cold-start time for the test-ubuntu job. | |
| shared-key: "ubuntu-stable" | |
| # Save cache even if a step fails. Keeps warm cache primed so | |
| # the next run (after fix) can benefit. | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - run: cargo fmt --all --check | |
| - run: cargo clippy --workspace -- -D warnings | |
| - run: cargo check --workspace | |
| - run: cargo check -p crab-cli --no-default-features | |
| - run: cargo check -p crab-cli -F full | |
| test: | |
| name: Test (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| # Ubuntu shares the check job's cache (same shared-key); win/mac | |
| # get their own per-OS cache (rust-cache keys on OS automatically). | |
| shared-key: ${{ matrix.os == 'ubuntu-latest' && 'ubuntu-stable' || '' }} | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - uses: taiki-e/install-action@nextest | |
| continue-on-error: true | |
| id: nextest | |
| - run: cargo nextest run --workspace | |
| if: steps.nextest.outcome == 'success' | |
| - run: cargo test --workspace | |
| if: steps.nextest.outcome != 'success' | |
| deny: | |
| name: Dependency audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: EmbarkStudios/cargo-deny-action@v2 |