Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve cargo example #1248

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Improve cargo example
Adds `restore-keys` for cargo - this helps improve build times by allowing the cache to be mostly pre-populated when deps are updated.

Adds two missing cache files.

Adds a build type parameter to the cache keys to account for different build profiles / targets.
  • Loading branch information
Fishrock123 committed Sep 25, 2023
commit 226a795b510330e9c0276451cfef186c0ed8af2e
8 changes: 7 additions & 1 deletion examples.md
Original file line number Diff line number Diff line change
@@ -589,14 +589,20 @@ whenever possible:

```yaml
- uses: actions/cache@v3
env:
BUILD_TYPE: debug # adjust when using `--release` or custom targets
with:
path: |
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-cargo-${{ env.BUILD_TYPE }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-${{ env.BUILD_TYPE }}-
```

## Scala - SBT