Skip to content

Commit

Permalink
Share cache between build and test jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
tbro committed Sep 26, 2024
1 parent ca214de commit dae9462
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ jobs:
- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2
with:
prefix-key: v1-rust
prefix-key: v0-rust
shared-key: build-test

- name: Build
# Build in release without `testing` feature, this should work without `hotshot_example` config.
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ jobs:

- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2
with:
shared-key: build-test

# Separate build step for easier identification of failures and timings.
- name: Build tests for coverage
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/slowtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:

- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2
with:
shared-key: build-test

- name: Build
# Build test binary with `testing` feature, which requires `hotshot_example` config
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test-demo-native-marketplace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:

- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2
with:
shared-key: build-test

- name: Build
run: cargo build --locked --release
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test-demo-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:

- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2
with:
shared-key: build-test

- name: Build
run: cargo build --locked --release
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:

- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2
with:
shared-key: build-test

- name: Build
# Build test binary with `testing` feature, which requires `hotshot_example` config
Expand Down

0 comments on commit dae9462

Please sign in to comment.