Skip to content

Commit a78e432

Browse files
committed
internal/ci: include more useful string values in base
Every repository has to repeat "latestGo", which is a bit silly. It's much easier to update it in one place, and re-run `cue mod get` across all repositories to get the update. Do the same with the previous Go release; even though just a few repos test on a matrix of Go versions, it's still useful as a base value. Also switch "cueCommand" to use `go tool cue`, which is the default we're currently switching to. Each repository can still override this, for example the cue repo as it must still support Go 1.23. However, the majority of repositories should be nudged in the direction of Go tool dependencies. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I599e0ea3a6ac1498ce151c66d5af91caad7e7cd1 Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1218981 Reviewed-by: Paul Jolly <[email protected]> Unity-Result: CUE porcuepine <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent 6d3530b commit a78e432

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

internal/ci/base/base.cue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ botGerritHubUserEmail: *botGitHubUserEmail | string
5858
unprivilegedBotGitHubUser: "not" + botGitHubUser
5959
unprivilegedBotGitHubUserCentralRegistryTokenSecretsKey: *(strings.ToUpper(unprivilegedBotGitHubUser) + "_CUE_TOKEN") | string
6060

61-
cueCommand: *"cue" | string
61+
// Most repositories will already be a Go module, so they can use a tool dependency.
62+
// Others can override this string with e.g. `cue` from the `setup-cue` action.
63+
cueCommand: *"go tool cue" | string
6264

6365
workflowFileExtension: ".yaml"
6466

@@ -86,6 +88,12 @@ linuxMachine: string | *linuxSmallMachine
8688
macosMachine: string | *"ns-macos-arm64"
8789
windowsMachine: string | *"ns-windows-amd64"
8890

91+
// Use the latest Go version for extra checks,
92+
// such as running tests with the data race detector.
93+
latestGo: "1.24.x"
94+
// Some repositories also want to ensure that the previous version works.
95+
previousGo: "1.23.x"
96+
8997
codeReview: #codeReview & {
9098
github: githubRepositoryURL
9199
gerrit: gerritHubRepositoryURL

internal/ci/github/trybot.cue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ workflows: trybot: _repo.bashWorkflow & {
8989
_testStrategy: {
9090
"fail-fast": false
9191
matrix: {
92-
"go-version": _repo.matrixGo
92+
"go-version": [_repo.previousGo, _repo.latestGo]
9393
runner: [_repo.linuxMachine, _repo.macosMachine, _repo.windowsMachine]
9494
}
9595
}

internal/ci/repo/repo.cue

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ botGitHubUserEmail: "[email protected]"
2929
// The tests on this repository are pretty CPU-intensive.
3030
linuxMachine: base.linuxLargeMachine
3131

32-
// Use the latest Go version for extra checks,
33-
// such as running tests with the data race detector.
34-
// This may be a release candidate if we are late into a Go release cycle.
35-
latestGo: "1.24.x"
36-
37-
// The list of all Go versions that we run our tests on.
38-
// This typically goes back one major Go version, as we support two at a time.
39-
matrixGo: ["1.23.x", latestGo]
40-
4132
// Use a specific latest version for release builds.
4233
// Note that we don't want ".x" for the sake of reproducibility,
4334
// so we instead pin a specific Go release.
@@ -63,4 +54,5 @@ zeroReleaseTagPattern: "*" + zeroReleaseTagSuffix
6354

6455
codeReview: "cue-unity": unityRepositoryURL
6556

57+
// TODO: we can't use `go tool cue` yet.
6658
cueCommand: "go run cuelang.org/go/cmd/cue"

0 commit comments

Comments
 (0)