Skip to content

Commit d94ecfe

Browse files
authored
build: Add Go module cache for GitHub actions (#164)
Adds the cache action to all workflows so that the Go modules can be pre-cached Signed-off-by: Marc Lopez <marc5.12@outlook.com>
1 parent 2e392d1 commit d94ecfe

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.github/workflows/go.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ jobs:
1616
- name: Check out code into the Go module directory
1717
uses: actions/checkout@v1
1818

19+
- name: Cache Go Modules
20+
uses: actions/cache@v1
21+
with:
22+
path: ~/go/pkg/mod
23+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
24+
restore-keys: |
25+
${{ runner.os }}-go-
26+
1927
- name: Get dependencies
2028
run: make vendor
2129
id: modules

.github/workflows/release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ jobs:
1919
go-version: 1.13
2020
id: go
2121

22+
- name: Cache Go Modules
23+
uses: actions/cache@v1
24+
with:
25+
path: ~/go/pkg/mod
26+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
27+
restore-keys: |
28+
${{ runner.os }}-go-
29+
2230
- name: Install hub
2331
uses: geertvdc/setup-hub@master
2432

0 commit comments

Comments
 (0)