Skip to content

Commit 4c704dc

Browse files
authored
Merge pull request #680 from Kixiron/master
Updated the GitHub Actions script to include caching
2 parents 157c5df + 540fa8a commit 4c704dc

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,33 @@ jobs:
1919
- name: Install stable Rust
2020
run: rustup update stable && rustup default stable
2121

22+
- name: Set rustc version
23+
run: echo "::set-env name=CURRENT_RUSTC_VERSION::$(rustc -V)"
24+
25+
# Caching
26+
- name: Cache Cargo Registry
27+
uses: actions/cache@v1
28+
with:
29+
path: ~/.cargo/registry
30+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
31+
- name: Cache Cargo Bin
32+
uses: actions/cache@v1
33+
with:
34+
path: ~/.cargo/bin
35+
key: ${{ runner.os }}-cargo-bin-${{ hashFiles('**/Cargo.lock') }}
36+
- name: Cache Cargo Git
37+
uses: actions/cache@v1
38+
with:
39+
path: ~/.cargo/git
40+
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
41+
- name: Cache Cargo Build
42+
uses: actions/cache@v1
43+
with:
44+
path: target
45+
key: ${{ runner.os }}-cargo-build-target-${{ env.CURRENT_RUSTC_VERSION }}-${{ hashFiles('**/Cargo.lock') }}
46+
restore-key: |
47+
${{ runner.os }}-cargo-build-target-${{ env.CURRENT_RUSTC_VERSION }}-
48+
2249
- name: Install PostgreSQL
2350
run: |
2451
sudo apt-get update && DEBIAN_FRONTEND=noninteractive sudo apt-get install -y postgresql

0 commit comments

Comments
 (0)