Skip to content

Commit f31cd41

Browse files
Copiloterezrokah
andcommitted
ci: disable setup-go built-in cache and add separate actions/cache steps
Co-authored-by: erezrokah <26760571+erezrokah@users.noreply.github.com>
1 parent 22101e7 commit f31cd41

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

.github/workflows/gen_coverage_report.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,21 @@ jobs:
2222
with:
2323
token: ${{ secrets.GH_CQ_BOT }}
2424
- name: Set up Go 1.x
25+
id: setup-go
2526
uses: actions/setup-go@v6
2627
with:
2728
go-version: "1.25"
2829
cache: false
30+
- name: Cache Go modules
31+
uses: actions/cache@v4
32+
with:
33+
path: |
34+
~/go/pkg/mod
35+
~/.cache/go-build
36+
key: ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }}
37+
restore-keys: |
38+
${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-
39+
${{ runner.os }}-go-
2940
- name: Generate Coverage Report
3041
run: make coverage
3142

.github/workflows/go_mod_tidy_examples.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,21 @@ jobs:
2121
with:
2222
token: ${{ secrets.GH_CQ_BOT }}
2323
- name: Set up Go 1.x
24+
id: setup-go
2425
uses: actions/setup-go@v6
2526
with:
2627
go-version-file: go.mod
2728
cache: false
29+
- name: Cache Go modules
30+
uses: actions/cache@v4
31+
with:
32+
path: |
33+
~/go/pkg/mod
34+
~/.cache/go-build
35+
key: ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }}
36+
restore-keys: |
37+
${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-
38+
${{ runner.os }}-go-
2839
- name: Run go mod tidy
2940
working-directory: examples/${{ matrix.plugin }}
3041
run: go mod tidy

.github/workflows/lint_golang.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,20 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v6
2020
- uses: actions/setup-go@v6
21+
id: setup-go
2122
with:
2223
go-version-file: go.mod
24+
cache: false
25+
- name: Cache Go modules
26+
uses: actions/cache@v4
27+
with:
28+
path: |
29+
~/go/pkg/mod
30+
~/.cache/go-build
31+
key: ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }}
32+
restore-keys: |
33+
${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-
34+
${{ runner.os }}-go-
2335
- name: golangci-lint
2436
uses: golangci/golangci-lint-action@v9
2537
with:

.github/workflows/unittest.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,21 @@ jobs:
2121
- name: Check out code into the Go module directory
2222
uses: actions/checkout@v6
2323
- name: Set up Go 1.x
24+
id: setup-go
2425
uses: actions/setup-go@v6
2526
with:
2627
go-version-file: go.mod
28+
cache: false
29+
- name: Cache Go modules
30+
uses: actions/cache@v4
31+
with:
32+
path: |
33+
~/go/pkg/mod
34+
~/.cache/go-build
35+
key: ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }}
36+
restore-keys: |
37+
${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-
38+
${{ runner.os }}-go-
2739
- run: go mod download
2840
- run: go build ./...
2941
- name: Run tests

0 commit comments

Comments
 (0)