Skip to content

Commit

Permalink
ci: Use sccache instead of rust-cache (#716)
Browse files Browse the repository at this point in the history
Performance is about the same, but this is consistent with tket2's CI
worflows.
  • Loading branch information
aborgna-q authored Nov 23, 2023
1 parent 954999d commit 592dd28
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ env:
RUSTFLAGS: "--cfg=ci_run"
MIRIFLAGS: '-Zmiri-permissive-provenance' # Required due to warnings in bitvec 1.0.1
CI: true # insta snapshots behave differently on ci
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: mozilla-actions/sccache-action@v0.0.3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
prefix-key: v0
- name: Check formatting
run: cargo fmt -- --check
- name: Run clippy
Expand All @@ -44,11 +44,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: mozilla-actions/sccache-action@v0.0.3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
prefix-key: v0
- name: Build benchmarks with no features
run: cargo bench --verbose --no-run --no-default-features
- name: Build benchmarks with all features
Expand All @@ -73,15 +71,13 @@ jobs:
name: tests (Rust ${{ matrix.rust }})
steps:
- uses: actions/checkout@v4
- uses: mozilla-actions/sccache-action@v0.0.3
- id: toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Configure default rust toolchain
run: rustup override set ${{steps.toolchain.outputs.name}}
- uses: Swatinem/rust-cache@v2
with:
prefix-key: v0-rust-${{ matrix.rust }}
- name: Build with no features
run: cargo test --verbose --no-default-features --no-run
- name: Tests with no features
Expand Down Expand Up @@ -114,4 +110,4 @@ jobs:
with:
files: coverage.json
name: ubuntu
token: ${{ secrets.CODECOV_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 592dd28

Please sign in to comment.