Skip to content

Commit ff4639c

Browse files
committed
internal/ci: cache staticcheck via nscloud-cache-action
Rather than staticcheck-action's built-in actions/cache caching, which is slower and inconsistent. Signed-off-by: Daniel Martí <[email protected]> Change-Id: Ia9334144a53c7805ce21e1267ac779da628dda57 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1217827 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Paul Jolly <[email protected]>
1 parent e2835d9 commit ff4639c

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.github/workflows/trybot.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ jobs:
8686
uses: namespacelabs/nscloud-cache-action@v1
8787
with:
8888
cache: go
89+
path: ${{ runner.temp }}/staticcheck
8990
- if: |-
9091
github.repository == 'cue-lang/cue' && (((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, '
9192
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test'))
@@ -145,6 +146,7 @@ jobs:
145146
with:
146147
version: "2025.1"
147148
install-go: false
149+
use-cache: false
148150
- if: (matrix.go-version == '1.24.x' && matrix.runner == 'namespace-profile-ubuntu-24-04-amd64-8x16')
149151
name: Check all git tags are available
150152
run: |-

internal/ci/base/github.cue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,16 @@ curlGitHubAPI: {
159159
setupGoActionsCaches: [
160160
// Our runner profiles on Namespace are already configured to only update
161161
// the cache when they run from one of the protected branches.
162+
// We cache for Go (GOCACHE and GOMODCACHE) and for staticcheck,
163+
// noting that staticcheck-action puts STATICCHECK_CACHE under runner.temp.
162164
githubactions.#Step & {
163165
uses: "namespacelabs/nscloud-cache-action@v1"
164-
with: cache: "go"
166+
with: {
167+
cache: "go"
168+
path: """
169+
${{ runner.temp }}/staticcheck
170+
"""
171+
}
165172
},
166173

167174
// All tests on protected branches should skip the test cache,

internal/ci/github/trybot.cue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ workflows: trybot: _repo.bashWorkflow & {
185185
with: {
186186
version: "2025.1" // Pin a version for determinism.
187187
"install-go": false // We install Go ourselves.
188+
"use-cache": false // We use a volume cache instead.
188189
}
189190
},
190191
]

0 commit comments

Comments
 (0)