Skip to content

Commit

Permalink
Add a rust build cache for workflows (#17)
Browse files Browse the repository at this point in the history
Adds two github cache actions. One for the toolchain and one for the
downloaded and built dependencies
  • Loading branch information
JustusAdam authored Jul 26, 2023
1 parent c63ed3b commit 241704b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ jobs:

steps:
- uses: actions/checkout@v3
# just triggers rustup to download the toolchain
- name: Cache Toolchain
uses: actions/cache@v3
with:
path: ~/.rustup
key: ${{ runner.os }}-rust-toolchain-${{ hashFiles('rust-toolchain.toml') }}
- name: Cache Dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-rust-deps-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
- name: Build
run: cargo build --verbose
- name: Run tests
Expand Down

0 comments on commit 241704b

Please sign in to comment.