Skip to content

Commit

Permalink
drop go1.21, start testing on go1.23rc2
Browse files Browse the repository at this point in the history
In preparation for CUE v0.10.0, which will be released around the same
time that Go 1.23.0 is released in mid-August.
This lets us get better early testing for Go 1.23, as well as start
taking advantage of some of the features in Go 1.22.

While here, move the Go version matrix declaration to repo.cue,
as we declared versions of Go which were only used for the matrix list.
It is more intuitive to declare the list directly, which also lets us
add or remove versions more easily, such as RCs for early testing.

Signed-off-by: Daniel Martí <[email protected]>
Change-Id: Ia66d9d4d0428681cee7352301b0bea41d7aa0dfe
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1198206
Unity-Result: CUE porcuepine <[email protected]>
Reviewed-by: Paul Jolly <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
  • Loading branch information
mvdan committed Jul 23, 2024
1 parent b3c12b3 commit 1aaf802
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 18 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/trybot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
fail-fast: false
matrix:
go-version:
- 1.21.x
- 1.22.x
- 1.23.0-rc.2
runner:
- ubuntu-22.04
- macos-14
Expand Down Expand Up @@ -101,7 +101,7 @@ 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.22.x' && matrix.runner == 'ubuntu-22.04')
- if: (matrix.go-version == '1.23.0-rc.2' && matrix.runner == 'ubuntu-22.04')
name: Early git and code sanity checks
run: |-
# Ensure that commit messages have a blank second line.
Expand Down Expand Up @@ -140,15 +140,15 @@ jobs:
echo "${commit_signers}"
exit 1
fi
- if: (matrix.go-version == '1.22.x' && matrix.runner == 'ubuntu-22.04')
- if: (matrix.go-version == '1.23.0-rc.2' && matrix.runner == 'ubuntu-22.04')
name: Generate
run: go generate ./...
- 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.22.x' && matrix.runner == 'ubuntu-22.04')
Dispatch-Trailer: {"type":"')))) || !(matrix.go-version == '1.23.0-rc.2' && matrix.runner == 'ubuntu-22.04')
name: Test
run: go test ./...
- if: (matrix.go-version == '1.22.x' && matrix.runner == 'ubuntu-22.04')
- if: (matrix.go-version == '1.23.0-rc.2' && matrix.runner == 'ubuntu-22.04')
name: Test with -race
run: go test -race ./...
env:
Expand All @@ -159,25 +159,25 @@ jobs:
id: auth
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.22.x' && matrix.runner == 'ubuntu-22.04')
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) && (matrix.go-version == '1.23.0-rc.2' && matrix.runner == 'ubuntu-22.04')
uses: google-github-actions/auth@v2
with:
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.22.x' && matrix.runner == 'ubuntu-22.04')
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) && (matrix.go-version == '1.23.0-rc.2' && matrix.runner == 'ubuntu-22.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.22.x' && matrix.runner == 'ubuntu-22.04')
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) && (matrix.go-version == '1.23.0-rc.2' && matrix.runner == 'ubuntu-22.04')
name: End-to-end test
env:
CUE_TEST_LOGINS: ${{ secrets.E2E_CUE_LOGINS }}
run: |-
cd internal/_e2e
go test -race
- if: (matrix.go-version == '1.22.x' && matrix.runner == 'ubuntu-22.04')
- if: (matrix.go-version == '1.23.0-rc.2' && matrix.runner == 'ubuntu-22.04')
name: Check
run: |-
go vet ./...
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.21 or later).
(1.22 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 @@ -15,7 +15,7 @@
-->
[![Go Reference](https://pkg.go.dev/badge/cuelang.org/go.svg)](https://pkg.go.dev/cuelang.org/go)
[![Github](https://github.com/cue-lang/cue/actions/workflows/trybot.yml/badge.svg)](https://github.com/cue-lang/cue/actions/workflows/trybot.yml?query=branch%3Amaster+event%3Apush)
[![Go 1.21+](https://img.shields.io/badge/go-1.21-9cf.svg)](https://golang.org/dl/)
[![Go 1.22+](https://img.shields.io/badge/go-1.22-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 Down Expand Up @@ -102,7 +102,7 @@ Download the [latest release](https://github.com/cue-lang/cue/releases/latest/)

#### Install from Source

You need [Go 1.21 or later](https://go.dev/doc/install) to install CUE from source:
You need [Go 1.22 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.21
go 1.22

require (
cuelabs.dev/go/oci/ociregistry v0.0.0-20240703134027-fa95d0563666
Expand Down
4 changes: 2 additions & 2 deletions internal/ci/github/trybot.cue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ workflows: trybot: _repo.bashWorkflow & {
_testStrategy: {
"fail-fast": false
matrix: {
"go-version": [_repo.previousStableGo, _repo.latestStableGo]
"go-version": _repo.matrixGo
runner: [_repo.linuxMachine, _repo.macosMachine, _repo.windowsMachine]
}
}
Expand All @@ -97,7 +97,7 @@ workflows: trybot: _repo.bashWorkflow & {
// is running on Linux with the latest version of Go. This expression is often
// used to run certain steps just once per CI workflow, to avoid duplicated
// work.
_isLatestLinux: "(\(goVersion) == '\(_repo.latestStableGo)' && \(matrixRunner) == '\(_repo.linuxMachine)')"
_isLatestLinux: "(\(goVersion) == '\(_repo.latestGo)' && \(matrixRunner) == '\(_repo.linuxMachine)')"

_goGenerate: json.#step & {
name: "Generate"
Expand Down
9 changes: 6 additions & 3 deletions internal/ci/repo/repo.cue
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ linuxMachine: "ubuntu-22.04"
macosMachine: "macos-14"
windowsMachine: "windows-2022"

previousStableGo: "1.21.x"

// Use the latest Go version for extra checks,
// such as running tests with the data race detector.
latestStableGo: "1.22.x"
// This may be a release candidate if we are late into a Go release cycle.
latestGo: "1.23.0-rc.2"

// 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]

// Use a specific latest version for release builds.
// Note that we don't want ".x" for the sake of reproducibility,
Expand Down

0 comments on commit 1aaf802

Please sign in to comment.