diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1e135d1cd..60106f7fb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,11 +53,11 @@ jobs: run: |- echo "github.event.head_commit.message contains Dispatch-Trailer but we are on a protected branch" false - - name: Install Go - uses: actions/setup-go@v5 - with: - cache: false - go-version: 1.23.0 + - name: Set GOTOOLCHAIN + run: |- + export GOTOOLCHAIN=go1.23.0 + echo "GOTOOLCHAIN=go1.23.0" >> $GITHUB_OUTPUT + go env - name: Setup qemu uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx diff --git a/.github/workflows/trybot.yml b/.github/workflows/trybot.yml index e6881ae64..582b22aaf 100644 --- a/.github/workflows/trybot.yml +++ b/.github/workflows/trybot.yml @@ -17,8 +17,8 @@ jobs: fail-fast: false matrix: go-version: - - 1.22.x - - 1.23.x + - go1.22.6 + - go1.23.0 runner: - ubuntu-22.04 - macos-14 @@ -66,11 +66,11 @@ jobs: run: |- echo "github.event.head_commit.message contains Dispatch-Trailer but we are on a protected branch" false - - name: Install Go - uses: actions/setup-go@v5 - with: - cache: false - go-version: ${{ matrix.go-version }} + - name: Set GOTOOLCHAIN + run: |- + export GOTOOLCHAIN=${{ matrix.go-version }} + echo "GOTOOLCHAIN=${{ matrix.go-version }}" >> $GITHUB_OUTPUT + go env - name: Get go mod cache directory id: go-mod-cache-dir run: echo "dir=$(go env GOMODCACHE)" >> ${GITHUB_OUTPUT} @@ -102,20 +102,20 @@ jobs: Dispatch-Trailer: {"type":"')))) || github.ref == 'refs/heads/ci/test') run: go clean -testcache - name: Early git and code sanity checks - if: (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-22.04') + if: (matrix.go-version == 'go1.23.0' && matrix.runner == 'ubuntu-22.04') run: go run ./internal/ci/checks - name: Generate run: go generate ./... - if: (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-22.04') + if: (matrix.go-version == 'go1.23.0' && matrix.runner == 'ubuntu-22.04') - name: Test 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-22.04') + Dispatch-Trailer: {"type":"')))) || !(matrix.go-version == 'go1.23.0' && matrix.runner == 'ubuntu-22.04') run: go test ./... - name: Test with -race env: GORACE: atexit_sleep_ms=10 - if: (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-22.04') + if: (matrix.go-version == 'go1.23.0' && matrix.runner == 'ubuntu-22.04') run: go test -race ./... - name: Test with -tags=cuewasm run: go test -tags cuewasm ./cmd/cue/cmd ./cue/interpreter/wasm @@ -124,24 +124,24 @@ jobs: uses: google-github-actions/auth@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-22.04') + Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) && (matrix.go-version == 'go1.23.0' && matrix.runner == 'ubuntu-22.04') with: credentials_json: ${{ secrets.E2E_GCLOUD_KEY }} - name: gcloud setup 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-22.04') + Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) && (matrix.go-version == 'go1.23.0' && matrix.runner == 'ubuntu-22.04') uses: google-github-actions/setup-gcloud@v2 - name: End-to-end test env: CUE_TEST_LOGINS: ${{ secrets.E2E_CUE_LOGINS }} 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-22.04') + Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) && (matrix.go-version == 'go1.23.0' && matrix.runner == 'ubuntu-22.04') run: |- cd internal/_e2e go test -race - - if: (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-22.04') + - if: (matrix.go-version == 'go1.23.0' && matrix.runner == 'ubuntu-22.04') name: Check run: |- go vet ./... diff --git a/internal/ci/base/github.cue b/internal/ci/base/github.cue index d9f081a2a..871ae7b96 100644 --- a/internal/ci/base/github.cue +++ b/internal/ci/base/github.cue @@ -16,13 +16,13 @@ bashWorkflow: json.#Workflow & { } installGo: json.#step & { - name: "Install Go" - uses: "actions/setup-go@v5" - with: { - // We do our own caching in setupGoActionsCaches. - cache: false - "go-version": string - } + #goVersion!: string + name: "Set GOTOOLCHAIN" + run: """ + export GOTOOLCHAIN=\(#goVersion) + echo "GOTOOLCHAIN=\(#goVersion)" >> $GITHUB_OUTPUT + go env + """ } checkoutCode: { @@ -100,7 +100,7 @@ checkoutCode: { earlyChecks: json.#step & { name: "Early git and code sanity checks" - run: "go run ./internal/ci/checks" + run: "go run ./internal/ci/checks" } curlGitHubAPI: { diff --git a/internal/ci/github/release.cue b/internal/ci/github/release.cue index f4d701bd8..c26198559 100644 --- a/internal/ci/github/release.cue +++ b/internal/ci/github/release.cue @@ -45,7 +45,7 @@ workflows: release: _repo.bashWorkflow & { steps: [ for v in _repo.checkoutCode {v}, _repo.installGo & { - with: "go-version": _repo.pinnedReleaseGo + #goVersion: _repo.pinnedReleaseGo }, json.#step & { name: "Setup qemu" diff --git a/internal/ci/github/trybot.cue b/internal/ci/github/trybot.cue index 4f9ce1c8a..05ba0ab59 100644 --- a/internal/ci/github/trybot.cue +++ b/internal/ci/github/trybot.cue @@ -52,7 +52,7 @@ workflows: trybot: _repo.bashWorkflow & { for v in _repo.checkoutCode {v}, _repo.installGo & { - with: "go-version": goVersionVal + #goVersion: goVersionVal }, // cachePre must come after installing Node and Go, because the cache locations diff --git a/internal/ci/repo/repo.cue b/internal/ci/repo/repo.cue index 1cf7ca7cb..8e91c9f44 100644 --- a/internal/ci/repo/repo.cue +++ b/internal/ci/repo/repo.cue @@ -31,16 +31,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: "go1.23.0" // 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: ["go1.22.6", 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.0" +pinnedReleaseGo: "go1.23.0" goreleaserVersion: "v2.2.0"