Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Make sure that cargo-nextest is cached as well
Browse files Browse the repository at this point in the history
The order matters here since rust-cache cleans out any files in
`~/.cargo/bin` that were present **before the action ran**, which means
we'll want to install nextest **after** running the cache job. The
install-action job will check for newer versions appropriately.

The one thing I'm not sure about is if rust-cache will key based off
of the contents of the `~/.cargo/bin` directory, or if it's just saving
that into the cache. If it does key off of the contents, we may need
to always install nextest even if it's not going to be used (for check/
format/lint jobs) so we can maintain cache efficiency.

See:
- https://github.com/Swatinem/rust-cache#cache-details
- taiki-e/install-action#66
  • Loading branch information
elasticdog committed May 5, 2023
1 parent 0ddd7a3 commit 99da843
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/cue/preload-cache.cue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ preloadCache: {
_#checkoutCode,
_#installRust,
_#cacheRust,
_#installTool & {with: tool: "cargo-nextest"},
_#cargoCheck,
]
}
Expand Down
2 changes: 1 addition & 1 deletion .github/cue/rust.cue
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ rust: _#useMergeQueue & {
steps: [
_#checkoutCode,
_#installRust,
_#installTool & {with: tool: "cargo-nextest"},
_#cacheRust,
_#installTool & {with: tool: "cargo-nextest"},
{
name: "Compile tests"
run: "cargo test --locked --no-run"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/preload-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ jobs:
uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f
with:
shared-key: workflow
- name: Install cargo-nextest
uses: taiki-e/install-action@a775aaf2e8ed709f76ee019cb77e39fc50613631
with:
tool: cargo-nextest
- name: Check packages and dependencies for errors
run: cargo check --locked
check_msrv:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ jobs:
with:
toolchain: stable
components: clippy,rustfmt
- name: Install cargo-nextest
uses: taiki-e/install-action@a775aaf2e8ed709f76ee019cb77e39fc50613631
with:
tool: cargo-nextest
- name: Cache dependencies
uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f
with:
shared-key: workflow
- name: Install cargo-nextest
uses: taiki-e/install-action@a775aaf2e8ed709f76ee019cb77e39fc50613631
with:
tool: cargo-nextest
- name: Compile tests
run: cargo test --locked --no-run
- name: Run tests
Expand Down

0 comments on commit 99da843

Please sign in to comment.