Skip to content

Commit 91a56cf

Browse files
KapJItwpayne
authored andcommitted
chore: Optimize Linux caches on CI
1 parent 6916263 commit 91a56cf

File tree

2 files changed

+56
-2
lines changed

2 files changed

+56
-2
lines changed

.github/workflows/govulncheck.yml

+9
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ jobs:
2424
id: go-version
2525
run: |
2626
echo go-version="$(awk '/GO_VERSION:/ { print $2 }' .github/workflows/main.yml | tr -d \')" >> "${GITHUB_OUTPUT}"
27+
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
28+
with:
29+
path: |
30+
/home/runner/go/pkg/mod
31+
/home/runner/.cache/go-build
32+
key: govulncheck-${{ runner.os }}-${{ steps.go-version.outputs.go-version }}-${{ hashFiles('**/go.sum') }}
33+
restore-keys: |
34+
govulncheck-${{ runner.os }}-${{ steps.go-version.outputs.go-version }}-
2735
- uses: golang/govulncheck-action@b625fbe08f3bccbe446d94fbf87fcc875a4f50ee
2836
with:
37+
cache: false
2938
go-version-input: ${{ steps.go-version.outputs.go-version }}

.github/workflows/main.yml

+47-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ jobs:
6868
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
6969
with:
7070
path: |
71-
~/.cache/go-build
72-
~/go/pkg/mod
71+
/home/runner/go/pkg/mod
72+
/home/runner/.cache/go-build
7373
key: setup-go-${{ runner.os }}-x64-ubuntu22-go-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
7474
restore-keys: |
7575
setup-go-${{ runner.os }}-x64-ubuntu22-go-${{ env.GO_VERSION }}-
@@ -207,8 +207,17 @@ jobs:
207207
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
208208
with:
209209
fetch-depth: 0
210+
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
211+
with:
212+
path: |
213+
/home/runner/go/pkg/mod
214+
/home/runner/.cache/go-build
215+
key: release-go-${{ runner.os }}-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
216+
restore-keys: |
217+
release-go-${{ runner.os }}-${{ env.GO_VERSION }}-
210218
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
211219
with:
220+
cache: false
212221
go-version: ${{ env.GO_VERSION }}
213222
- name: install-release-dependencies
214223
if: github.event_name == 'push' || needs.changes.outputs.code == 'true'
@@ -268,8 +277,17 @@ jobs:
268277
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
269278
with:
270279
fetch-depth: 0
280+
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
281+
with:
282+
path: |
283+
/home/runner/go/pkg/mod
284+
/home/runner/.cache/go-build
285+
key: setup-go-${{ runner.os }}-x64-ubuntu22-go-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
286+
restore-keys: |
287+
setup-go-${{ runner.os }}-x64-ubuntu22-go-${{ env.GO_VERSION }}-
271288
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
272289
with:
290+
cache: false
273291
go-version: ${{ env.GO_VERSION }}
274292
- name: install-age
275293
if: github.event_name == 'push' || needs.changes.outputs.code == 'true'
@@ -308,8 +326,17 @@ jobs:
308326
contents: read
309327
steps:
310328
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
329+
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
330+
with:
331+
path: |
332+
/home/runner/go/pkg/mod
333+
/home/runner/.cache/go-build
334+
key: website-go-${{ runner.os }}-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
335+
restore-keys: |
336+
website-go-${{ runner.os }}-${{ env.GO_VERSION }}-
311337
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
312338
with:
339+
cache: false
313340
go-version: ${{ env.GO_VERSION }}
314341
- uses: astral-sh/setup-uv@2e657c127d5b1635d5a8e3fa40e0ac50a5bf6992
315342
with:
@@ -456,8 +483,17 @@ jobs:
456483
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
457484
with:
458485
fetch-depth: 0
486+
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
487+
with:
488+
path: |
489+
/home/runner/go/pkg/mod
490+
/home/runner/.cache/go-build
491+
key: release-go-${{ runner.os }}-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
492+
restore-keys: |
493+
release-go-${{ runner.os }}-${{ env.GO_VERSION }}-
459494
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
460495
with:
496+
cache: false
461497
go-version: ${{ env.GO_VERSION }}
462498
- uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da
463499
- name: create-syso
@@ -484,8 +520,17 @@ jobs:
484520
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
485521
with:
486522
fetch-depth: 0
523+
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
524+
with:
525+
path: |
526+
/home/runner/go/pkg/mod
527+
/home/runner/.cache/go-build
528+
key: website-go-${{ runner.os }}-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
529+
restore-keys: |
530+
website-go-${{ runner.os }}-${{ env.GO_VERSION }}-
487531
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
488532
with:
533+
cache: false
489534
go-version: ${{ env.GO_VERSION }}
490535
- uses: astral-sh/setup-uv@2e657c127d5b1635d5a8e3fa40e0ac50a5bf6992
491536
with:

0 commit comments

Comments
 (0)