Skip to content

Commit

Permalink
chore: Optimize Linux caches on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
KapJI committed Nov 8, 2024
1 parent 0837305 commit 5d6724e
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/govulncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ jobs:
id: go-version
run: |
echo go-version="$(awk '/GO_VERSION:/ { print $2 }' .github/workflows/main.yml | tr -d \')" >> "${GITHUB_OUTPUT}"
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
with:
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: govulncheck-${{ runner.os }}-${{ steps.go-version.outputs.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
govulncheck-${{ runner.os }}-${{ steps.go-version.outputs.go-version }}-
- uses: golang/govulncheck-action@b625fbe08f3bccbe446d94fbf87fcc875a4f50ee
with:
cache: false
go-version-input: ${{ steps.go-version.outputs.go-version }}
49 changes: 47 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ jobs:
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
with:
path: |
~/.cache/go-build
~/go/pkg/mod
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: setup-go-${{ runner.os }}-x64-ubuntu22-go-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
setup-go-${{ runner.os }}-x64-ubuntu22-go-${{ env.GO_VERSION }}-
Expand Down Expand Up @@ -207,8 +207,17 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
with:
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: release-go-${{ runner.os }}-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
release-go-${{ runner.os }}-${{ env.GO_VERSION }}-
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
cache: false
go-version: ${{ env.GO_VERSION }}
- name: install-release-dependencies
if: github.event_name == 'push' || needs.changes.outputs.code == 'true'
Expand Down Expand Up @@ -268,8 +277,17 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
with:
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: setup-go-${{ runner.os }}-x64-ubuntu22-go-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
setup-go-${{ runner.os }}-x64-ubuntu22-go-${{ env.GO_VERSION }}-
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
cache: false
go-version: ${{ env.GO_VERSION }}
- name: install-age
if: github.event_name == 'push' || needs.changes.outputs.code == 'true'
Expand Down Expand Up @@ -308,8 +326,17 @@ jobs:
contents: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
with:
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: website-go-${{ runner.os }}-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
website-go-${{ runner.os }}-${{ env.GO_VERSION }}-
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
cache: false
go-version: ${{ env.GO_VERSION }}
- uses: astral-sh/setup-uv@2e657c127d5b1635d5a8e3fa40e0ac50a5bf6992
with:
Expand Down Expand Up @@ -456,8 +483,17 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
with:
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: release-go-${{ runner.os }}-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
release-go-${{ runner.os }}-${{ env.GO_VERSION }}-
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
cache: false
go-version: ${{ env.GO_VERSION }}
- uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da
- name: create-syso
Expand All @@ -484,8 +520,17 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
with:
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: website-go-${{ runner.os }}-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
website-go-${{ runner.os }}-${{ env.GO_VERSION }}-
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
cache: false
go-version: ${{ env.GO_VERSION }}
- uses: astral-sh/setup-uv@2e657c127d5b1635d5a8e3fa40e0ac50a5bf6992
with:
Expand Down

0 comments on commit 5d6724e

Please sign in to comment.