Skip to content

Commit 3eae5a9

Browse files
authored
Merge pull request #170 from scaleway/fix_caching
chore: fix checkout and setup-go ordering to optimize cache usage
2 parents b9db956 + 7359ec0 commit 3eae5a9

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

.github/workflows/pull-request.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ jobs:
1111
platform: [ubuntu-latest]
1212
runs-on: ${{ matrix.platform }}
1313
steps:
14-
- name: Install Go
15-
uses: actions/setup-go@v1
16-
with:
17-
go-version: ${{ matrix.go-version }}
14+
# Checkout should always be before setup-go to ensure caching is working
1815
- name: checkout
1916
uses: actions/checkout@v3
2017
with:
2118
fetch-depth: 1
19+
- name: Install Go
20+
uses: actions/setup-go@v1
21+
with:
22+
go-version: ${{ matrix.go-version }}
2223
- name: Run unit tests
2324
run: make test
2425
build-test:
@@ -29,13 +30,14 @@ jobs:
2930
arch: [386, amd64, arm, arm64]
3031
runs-on: ${{ matrix.platform }}
3132
steps:
32-
- name: Install Go
33-
uses: actions/setup-go@v1
34-
with:
35-
go-version: ${{ matrix.go-version }}
33+
# Checkout should always be before setup-go to ensure caching is working
3634
- name: checkout
3735
uses: actions/checkout@v2
3836
with:
3937
fetch-depth: 1
38+
- name: Install Go
39+
uses: actions/setup-go@v1
40+
with:
41+
go-version: ${{ matrix.go-version }}
4042
- name: Building binary
4143
run: GOARCH=${{ matrix.arch }} make compile

0 commit comments

Comments
 (0)