Skip to content

Commit 01b726a

Browse files
authored
Merge pull request #1069 from golangci/feature/github-actions-mod-cache
dev: add mod cache in gh actions
2 parents bf7eef0 + 908d91b commit 01b726a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/pr.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ jobs:
1313
strategy:
1414
matrix:
1515
golang:
16-
- 1.12
1716
- 1.13
1817
- 1.14
1918
steps:
2019
- uses: actions/checkout@v2
2120
- name: Install Go
22-
uses: actions/setup-go@v1
21+
uses: actions/setup-go@v2
2322
with:
2423
go-version: ${{ matrix.golang }}
2524
- name: Run tests on Windows
@@ -30,7 +29,6 @@ jobs:
3029
strategy:
3130
matrix:
3231
golang:
33-
- 1.12
3432
- 1.13
3533
- 1.14
3634
os:
@@ -39,9 +37,15 @@ jobs:
3937
steps:
4038
- uses: actions/checkout@v2
4139
- name: Install Go
42-
uses: actions/setup-go@v1
40+
uses: actions/setup-go@v2
4341
with:
4442
go-version: ${{ matrix.golang }}
43+
- uses: actions/cache@v1
44+
with:
45+
path: ~/go/pkg/mod
46+
key: ${{ runner.os }}-go-${{ matrix.golang }}-${{ hashFiles('**/go.sum') }}
47+
restore-keys: |
48+
${{ runner.os }}-go-${{ matrix.golang }}-
4549
- name: Run tests on Unix-like operating systems
4650
run: make test
4751
check_generated:
@@ -51,7 +55,7 @@ jobs:
5155
- name: Unshallow
5256
run: git fetch --prune --unshallow
5357
- name: Install Go
54-
uses: actions/setup-go@v1
58+
uses: actions/setup-go@v2
5559
with:
5660
go-version: 1.14
5761
- name: Check if README.md is up to date

0 commit comments

Comments
 (0)