Skip to content

Commit

Permalink
Use Swatinem/rust-cache@v2 for caching
Browse files Browse the repository at this point in the history
`sccache` does not speedup CI at all, so switching to another
action which is known to be able to actually speedup CI.

Signed-off-by: Jiahao XU <[email protected]>
  • Loading branch information
NobodyXu committed Aug 12, 2023
1 parent e9135a6 commit 5aa1303
Showing 1 changed file with 3 additions and 37 deletions.
40 changes: 3 additions & 37 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ env:
RUSTDOCFLAGS: -Dwarnings
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
CARGO_INCREMENTAL: 0
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse

Expand Down Expand Up @@ -50,19 +48,7 @@ jobs:

- name: Create Cargo.lock for caching
run: cargo update
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-index-os-check-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-index-os-check-${{ matrix.target }}
cargo-index-os-check-
cargo-index-
- uses: mozilla-actions/[email protected]
- uses: Swatinem/rust-cache@v2

- run: |
cargo hack check --feature-powerset --target ${{ matrix.target }} ${{ matrix.args }}
Expand All @@ -81,17 +67,7 @@ jobs:
- name: Create Cargo.lock for caching
run: cargo update
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-index-check-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-index-check-
cargo-index-
- uses: mozilla-actions/[email protected]
- uses: Swatinem/rust-cache@v2

- run: ./check.sh

Expand All @@ -108,17 +84,7 @@ jobs:

- name: Create Cargo.lock for caching
run: cargo update
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-index-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-index-build-
cargo-index-
- uses: mozilla-actions/[email protected]
- uses: Swatinem/rust-cache@v2

- name: Compile tests
run: cargo test --all-features --workspace --no-run
Expand Down

0 comments on commit 5aa1303

Please sign in to comment.