Skip to content
This repository was archived by the owner on Mar 16, 2024. It is now read-only.

Commit dc9cc3f

Browse files
authored
Merge pull request #1994 from tylerslaton/build-jet-cache
Use buildjet's cache for Golang dependencies
2 parents daf8b68 + 49c74b5 commit dc9cc3f

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/test.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,17 @@ jobs:
2020
fetch-depth: 1
2121
- uses: actions/setup-go@v4
2222
with:
23+
cache: false
2324
go-version: "1.20"
25+
- name: Setup Golang caches
26+
uses: buildjet/cache@v3
27+
with:
28+
path: |
29+
~/.cache/go-build
30+
~/go/pkg/mod
31+
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
32+
restore-keys: |
33+
${{ runner.os }}-golang-
2434
- run: make validate-code
2535
- run: make build
2636
unit:
@@ -32,7 +42,17 @@ jobs:
3242
fetch-depth: 1
3343
- uses: actions/setup-go@v4
3444
with:
45+
cache: false
3546
go-version: "1.20"
47+
- name: Setup Golang caches
48+
uses: buildjet/cache@v3
49+
with:
50+
path: |
51+
~/.cache/go-build
52+
~/go/pkg/mod
53+
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
54+
restore-keys: |
55+
${{ runner.os }}-golang-
3656
- name: Run unit tests
3757
id: unit-test
3858
run: TEST_FLAGS="--junitfile unit-test-summary.xml" make unit
@@ -50,7 +70,17 @@ jobs:
5070
fetch-depth: 1
5171
- uses: actions/setup-go@v4
5272
with:
73+
cache: false
5374
go-version: "1.20"
75+
- name: Setup Golang caches
76+
uses: buildjet/cache@v3
77+
with:
78+
path: |
79+
~/.cache/go-build
80+
~/go/pkg/mod
81+
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
82+
restore-keys: |
83+
${{ runner.os }}-golang-
5484
- uses: debianmaster/actions-k3s@v1.0.5
5585
with:
5686
version: 'v1.27.2-k3s1'

0 commit comments

Comments
 (0)