Skip to content

Commit

Permalink
internal/ci: switch to actions/setup-go@v4
Browse files Browse the repository at this point in the history
The only breaking change is that caching is on by default now.
It's decent by default, caching both GOCACHE and GOMODCACHE
as reported by `go env`.

However, we already do our own caching in a similar vein,
and we're more careful to keep the caches trimmed down.
For that reason, keep the automatic caching turned off.

While looking at this code again, I was reminded that setup-go already
runs `go env`, so it could be giving us GOCACHE and GOMODCACHE directly.
Sure enough, someone already suggested this in the issue tracker,
so add a TODO to hopefully switch to it in the near future.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Ia6b8be3e79b53cb13f68c927674a29e57f164d02
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/551773
Unity-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Paul Jolly <paul@myitcv.io>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
  • Loading branch information
mvdan committed Mar 27, 2023
1 parent ed2a9c7 commit d9c354b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ jobs:
- name: Restore git file modification times
uses: chetan/git-restore-mtime-action@075f9bc9d159805603419d50f794bd9f33252ebe
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
cache: false
go-version: 1.19.7
- name: Setup qemu
uses: docker/setup-qemu-action@v2
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/trybot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ jobs:
- name: Restore git file modification times
uses: chetan/git-restore-mtime-action@075f9bc9d159805603419d50f794bd9f33252ebe
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
cache: false
go-version: ${{ matrix.go-version }}
- id: go-mod-cache-dir
name: Get go mod cache directory
Expand Down
6 changes: 5 additions & 1 deletion internal/ci/base/github.cue
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ bashWorkflow: json.#Workflow & {

installGo: json.#step & {
name: "Install Go"
uses: "actions/setup-go@v3"
uses: "actions/setup-go@v4"
with: {
// We do our own caching in setupGoActionsCaches.
cache: false
"go-version": *"${{ matrix.go-version }}" | string
}
}
Expand Down Expand Up @@ -139,6 +141,8 @@ setupGoActionsCaches: {
// pre is the list of steps required to establish and initialise the correct
// caches for Go-based workflows.
[
// TODO: once https://github.com/actions/setup-go/issues/54 is fixed,
// we could use `go env` outputs from the setup-go step.
json.#step & {
name: "Get go mod cache directory"
id: goModCacheDirID
Expand Down

0 comments on commit d9c354b

Please sign in to comment.