Skip to content

Commit d472f3e

Browse files
Hidenori MATSUKIHidenori MATSUKI
authored andcommitted
use cache on github actions
1 parent f3df9b1 commit d472f3e

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.github/workflows/publish-packge-on-github-release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,23 @@ jobs:
4444

4545
- uses: actions/checkout@v2
4646

47+
# https://github.com/actions/cache/blob/master/examples.md#rust---cargo
48+
- name: Cache cargo registry
49+
uses: actions/cache@v1
50+
with:
51+
path: ~/.cargo/registry
52+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
53+
- name: Cache cargo index
54+
uses: actions/cache@v1
55+
with:
56+
path: ~/.cargo/git
57+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
58+
- name: Cache cargo build
59+
uses: actions/cache@v1
60+
with:
61+
path: target
62+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
63+
4764
- name: Restore upload URL from artifact
4865
uses: actions/download-artifact@v1
4966
with:

.github/workflows/test-all.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: test-all
22

33
on:
44
push:
5+
tags-ignore:
6+
- "v*"
7+
paths-ignore:
8+
- README.md
9+
- "docs/**"
510

611
jobs:
712
build-and-test:
@@ -14,6 +19,24 @@ jobs:
1419
- windows-latest
1520
steps:
1621
- uses: actions/checkout@v2
22+
23+
# https://github.com/actions/cache/blob/master/examples.md#rust---cargo
24+
- name: Cache cargo registry
25+
uses: actions/cache@v1
26+
with:
27+
path: ~/.cargo/registry
28+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
29+
- name: Cache cargo index
30+
uses: actions/cache@v1
31+
with:
32+
path: ~/.cargo/git
33+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
34+
- name: Cache cargo build
35+
uses: actions/cache@v1
36+
with:
37+
path: target
38+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
39+
1740
- uses: actions-rs/toolchain@v1
1841
with:
1942
toolchain: stable

0 commit comments

Comments
 (0)