Skip to content

Commit

Permalink
Add proper Go caching for CI (#402)
Browse files Browse the repository at this point in the history
* Add proper Go caching for CI

* Fix cache paths
  • Loading branch information
DavidSGK authored May 15, 2024
1 parent 487f463 commit 0f83d91
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Configure git for private modules
env:
TOKEN: ${{ secrets.CI_PERSONAL_ACCESS_TOKEN }}
Expand All @@ -16,12 +16,25 @@ jobs:
github_token: ${{ secrets.CI_PERSONAL_ACCESS_TOKEN }}
- uses: bufbuild/buf-lint-action@v1
- name: setup-go
if: success()
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: go-cache
uses: actions/cache@v4
with:
# Go bin cache, mod cache, build cache, etc. - these are custom set by makego
# which is why actions/setup-go can't handle caching properly
# Also hash by makefiles because some things (like golangcilint version) are defined there
path: |
~/.cache/cli/${{ runner.os }}/x86_64/bin
~/.cache/cli/${{ runner.os }}/x86_64/go/pkg/mod
~/.cache/cli/${{ runner.os }}/x86_64/gocache
~/.cache/cli/${{ runner.os }}/x86_64/include
~/.cache/cli/${{ runner.os }}/x86_64/versions
~/.cache/cli/${{ runner.os }}/x86_64/golangci-lint
key: go-cache-cli-${{ hashFiles('go.sum', 'make/**') }}
restore-keys: go-cache-cli-
- name: ci
env:
GITHUB_TOKEN: ${{ secrets.CI_PERSONAL_ACCESS_TOKEN }}
if: success()
run: make ci

0 comments on commit 0f83d91

Please sign in to comment.