Skip to content

Commit

Permalink
Add cargo example for Rust project (#8)
Browse files Browse the repository at this point in the history
* Add cargo example

* Add hash of Cargo.lock to keys of caches

* Move Rust example to examples.md
  • Loading branch information
Linda_pp authored and Josh Gross committed Nov 4, 2019
1 parent 8c4c641 commit 57f889e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- [Ruby - Gem](#ruby---gem)
- [Go - Modules](#go---modules)
- [Elixir - Mix](#elixir---mix)
- [Rust - Cargo](#rust---cargo)

## Node - npm

Expand Down Expand Up @@ -119,3 +120,23 @@ uses: actions/cache@preview
restore-keys: |
${{ runner.os }}-mix-
```
## Rust - Cargo
```
- name: Cache cargo registry
uses: actions/cache@preview
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@preview
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@preview
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
```

0 comments on commit 57f889e

Please sign in to comment.