Skip to content

Commit b09a65b

Browse files
authored
chore: fix checkout and setup-go ordering to optimize cache usage (#2678)
1 parent 966fd21 commit b09a65b

7 files changed

+22
-12
lines changed

.github/workflows/acceptance-tests.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ jobs:
4343
- webhosting
4444
runs-on: ubuntu-latest
4545
steps:
46+
# Checkout should always be before setup-go to ensure caching is working
47+
- name: Checkout
48+
uses: actions/checkout@v4
4649
- name: Install Go
4750
uses: actions/setup-go@v5
4851
with:
4952
go-version: 1.22
50-
- name: Checkout
51-
uses: actions/checkout@v4
5253
- name: Run Acceptance Tests
5354
run: go test -v ./internal/services/${{ matrix.products }} -timeout=2h
5455
env:
@@ -66,12 +67,13 @@ jobs:
6667
fail-fast: false
6768
runs-on: ubuntu-latest
6869
steps:
70+
# Checkout should always be before setup-go to ensure caching is working
71+
- name: Checkout
72+
uses: actions/checkout@v4
6973
- name: Install Go
7074
uses: actions/setup-go@v5
7175
with:
7276
go-version: 1.22
73-
- name: Checkout
74-
uses: actions/checkout@v4
7577
- name: Run scwconfig tests
7678
run: go test -v ./internal/services/scwconfig -timeout=2m
7779
env:

.github/workflows/coverage.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
steps:
12+
# Checkout should always be before setup-go to ensure caching is working
1213
- uses: actions/checkout@v4
1314
with:
1415
fetch-depth: 2

.github/workflows/documentation.yml

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
misspell:
3939
runs-on: ubuntu-latest
4040
steps:
41+
# Checkout should always be before setup-go to ensure caching is working
4142
- uses: actions/checkout@v4
4243
- uses: actions/setup-go@v5
4344
with:

.github/workflows/nightly.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ jobs:
4444
- webhosting
4545
runs-on: ubuntu-latest
4646
steps:
47+
# Checkout should always be before setup-go to ensure caching is working
48+
- name: Checkout
49+
uses: actions/checkout@v4
4750
- name: Install Go
4851
uses: actions/setup-go@v5
4952
with:
5053
go-version: 1.22
51-
- name: Checkout
52-
uses: actions/checkout@v4
5354
- name: Run Acceptance Tests
5455
run: go test -v ./internal/services/${{ matrix.products }} -timeout=4h
5556
env:
@@ -92,12 +93,13 @@ jobs:
9293
needs: nightly
9394
if: always()
9495
steps:
96+
# Checkout should always be before setup-go to ensure caching is working
97+
- name: Checkout
98+
uses: actions/checkout@v4
9599
- name: Install Go
96100
uses: actions/setup-go@v5
97101
with:
98102
go-version: 1.22
99-
- name: Checkout
100-
uses: actions/checkout@v4
101103
- name: Run sweepers
102104
run: make sweep
103105
env:

.github/workflows/release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
goreleaser:
1919
runs-on: ubuntu-latest
2020
steps:
21+
# Checkout should always be before setup-go to ensure caching is working
2122
- name: Checkout
2223
uses: actions/checkout@v4
2324

.github/workflows/tfproviderlint.yml

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
tfproviderlint:
1010
runs-on: ubuntu-latest
1111
steps:
12+
# Checkout should always be before setup-go to ensure caching is working
1213
- uses: actions/checkout@v4
1314
- uses: actions/setup-go@v5
1415
with:
@@ -20,6 +21,7 @@ jobs:
2021
tfproviderdocs:
2122
runs-on: ubuntu-latest
2223
steps:
24+
# Checkout should always be before setup-go to ensure caching is working
2325
- uses: actions/checkout@v4
2426
- uses: actions/setup-go@v5
2527
with:

.github/workflows/unit-tests.yaml

+5-4
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ jobs:
1212
platform: [ubuntu-latest]
1313
runs-on: ${{ matrix.platform }}
1414
steps:
15-
- name: Install Go
16-
uses: actions/setup-go@v5
17-
with:
18-
go-version: ${{ matrix.go-version }}
15+
# Checkout should always be before setup-go to ensure caching is working
1916
- name: Checkout
2017
uses: actions/checkout@v4
2118
with:
2219
fetch-depth: 1
20+
- name: Install Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: ${{ matrix.go-version }}
2324
- name: Build binaries
2425
run: make build
2526
- name: Run unit tests

0 commit comments

Comments
 (0)