Skip to content

Commit

Permalink
require Go 1.23 or later, test and release with Go 1.24
Browse files Browse the repository at this point in the history
The only other required change as part of this is bumping staticcheck,
as usually it needs a new release to support a new major version of Go.

Cleanups such as resolving TODOs can be done in follow-up changes.

Signed-off-by: Daniel Martí <[email protected]>
Change-Id: I79d401badacd8107341a4386c3e49b81e870e82f
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1208839
Unity-Result: CUE porcuepine <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Paul Jolly <[email protected]>
  • Loading branch information
mvdan committed Feb 16, 2025
1 parent d12c8be commit 1a8c16d
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
uses: actions/setup-go@v5
with:
cache: false
go-version: 1.23.5
go-version: 1.24.0
- name: Set common go env vars
run: |-
go env -w GOTOOLCHAIN=local
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/trybot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
fail-fast: false
matrix:
go-version:
- 1.22.x
- 1.23.x
- 1.24.x
runner:
- ubuntu-24.04
- macos-14
Expand Down Expand Up @@ -107,20 +107,20 @@ jobs:
github.repository == 'cue-lang/cue' && (((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, '
Dispatch-Trailer: {"type":"')))) || github.ref == 'refs/heads/ci/test')
run: go clean -testcache
- if: (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04')
- if: (matrix.go-version == '1.24.x' && matrix.runner == 'ubuntu-24.04')
name: Early git and code sanity checks
run: go run ./internal/ci/checks
- if: |-
((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, '
Dispatch-Trailer: {"type":"')))) || !(matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04')
Dispatch-Trailer: {"type":"')))) || !(matrix.go-version == '1.24.x' && matrix.runner == 'ubuntu-24.04')
name: Test
run: go test ./...
- if: (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04')
- if: (matrix.go-version == '1.24.x' && matrix.runner == 'ubuntu-24.04')
name: Test with -race
env:
GORACE: atexit_sleep_ms=10
run: go test -race ./...
- if: (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04')
- if: (matrix.go-version == '1.24.x' && matrix.runner == 'ubuntu-24.04')
name: Test on 32 bits
env:
GOARCH: "386"
Expand All @@ -133,35 +133,35 @@ jobs:
credentials_json: ${{ secrets.E2E_GCLOUD_KEY }}
if: |-
github.repository == 'cue-lang/cue' && (((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, '
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) && (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04')
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) && (matrix.go-version == '1.24.x' && matrix.runner == 'ubuntu-24.04')
name: gcloud auth for end-to-end tests
- if: |-
github.repository == 'cue-lang/cue' && (((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, '
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) && (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04')
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) && (matrix.go-version == '1.24.x' && matrix.runner == 'ubuntu-24.04')
name: gcloud setup for end-to-end tests
uses: google-github-actions/setup-gcloud@v2
- if: |-
github.repository == 'cue-lang/cue' && (((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, '
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) && (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04')
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) && (matrix.go-version == '1.24.x' && matrix.runner == 'ubuntu-24.04')
name: End-to-end test
run: |-
cd internal/_e2e
go test -race
env:
CUE_TEST_TOKEN: ${{ secrets.E2E_PORCUEPINE_CUE_TOKEN }}
- if: (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04')
- if: (matrix.go-version == '1.24.x' && matrix.runner == 'ubuntu-24.04')
name: Go checks
run: |-
go vet ./...
go mod tidy
(cd internal/_e2e && go test -run=-)
- if: (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04')
- if: (matrix.go-version == '1.24.x' && matrix.runner == 'ubuntu-24.04')
name: staticcheck
uses: dominikh/staticcheck-action@v1
with:
version: 2024.1.1
version: "2025.1"
install-go: false
- if: (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04')
- if: (matrix.go-version == '1.24.x' && matrix.runner == 'ubuntu-24.04')
name: Check all git tags are available
run: |-
cd $(mktemp -d)
Expand All @@ -177,7 +177,7 @@ jobs:
echo "Did you forget about refs/attic branches? https://github.com/cue-lang/cue/wiki/Notes-for-project-maintainers"
exit 1
fi
- if: (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04')
- if: (matrix.go-version == '1.24.x' && matrix.runner == 'ubuntu-24.04')
name: Generate
env:
CUE_TOKEN: ${{ secrets.NOTCUECKOO_CUE_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ href="mailto:[email protected]">[email protected]</a>.
The code contribution process used by the CUE project is a little different from
that used by other open source projects. We assume you have a basic
understanding of [`git`](https://git-scm.com/) and [Go](https://golang.org)
(1.22 or later).
(1.23 or later).

The first thing to decide is whether you want to contribute a code change via
GitHub or GerritHub. Both workflows are fully supported, and whilst GerritHub is
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
[![Go Reference](https://pkg.go.dev/badge/cuelang.org/go.svg)](https://pkg.go.dev/cuelang.org/go)
[![Documentation](https://img.shields.io/badge/CUE-Docs-0066ff)](https://cuelang.org/docs/)
[![Github](https://github.com/cue-lang/cue/actions/workflows/trybot.yaml/badge.svg)](https://github.com/cue-lang/cue/actions/workflows/trybot.yaml?query=branch%3Amaster+event%3Apush)
[![Go 1.22+](https://img.shields.io/badge/go-1.22-9cf.svg)](https://golang.org/dl/)
[![Go 1.23+](https://img.shields.io/badge/go-1.23-9cf.svg)](https://golang.org/dl/)
[![platforms](https://img.shields.io/badge/platforms-linux|windows|macos-inactive.svg)]()
[![Docker Image](https://img.shields.io/docker/v/cuelang/cue?sort=semver&label=docker)](https://hub.docker.com/r/cuelang/cue)

Expand All @@ -43,7 +43,7 @@ Download the [latest release](https://github.com/cue-lang/cue/releases/latest/)

#### Install from Source

You need [Go 1.22 or later](https://go.dev/doc/install) to install CUE from source:
You need [Go 1.23 or later](https://go.dev/doc/install) to install CUE from source:

go install cuelang.org/go/cmd/cue@latest

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cuelang.org/go

go 1.22.0
go 1.23.0

require (
cuelabs.dev/go/oci/ociregistry v0.0.0-20241125120445-2c00c104c6e1
Expand Down
2 changes: 1 addition & 1 deletion internal/ci/github/trybot.cue
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ workflows: trybot: _repo.bashWorkflow & {
// Note that we should then persist staticcheck's cache too.
uses: "dominikh/staticcheck-action@v1"
with: {
version: "2024.1.1" // Pin a version for determinism.
version: "2025.1" // Pin a version for determinism.
"install-go": false // We install Go ourselves.
}
},
Expand Down
6 changes: 3 additions & 3 deletions internal/ci/repo/repo.cue
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ windowsMachine: "windows-2022"
// Use the latest Go version for extra checks,
// such as running tests with the data race detector.
// This may be a release candidate if we are late into a Go release cycle.
latestGo: "1.23.x"
latestGo: "1.24.x"

// The list of all Go versions that we run our tests on.
// This typically goes back one major Go version, as we support two at a time.
matrixGo: ["1.22.x", latestGo]
matrixGo: ["1.23.x", latestGo]

// Use a specific latest version for release builds.
// Note that we don't want ".x" for the sake of reproducibility,
// so we instead pin a specific Go release.
pinnedReleaseGo: "1.23.5"
pinnedReleaseGo: "1.24.0"

goreleaserVersion: "v2.5.0"

Expand Down

0 comments on commit 1a8c16d

Please sign in to comment.