Skip to content

Commit 4e88979

Browse files
committed
ci: build with the go1.27 release candidate instead of gotip
Go 1.27 release candidates are out, so CI no longer needs to bootstrap and cache a gotip devel toolchain. Both workflows now install go1.27rc2 with a single actions/setup-go, which also handles the module and build caches -- dropping the separate gotip SDK and Go cache steps. The version is pinned in a GO_VERSION env var in each workflow so moving to a later RC, or to '1.27' once 1.27.0 ships, is a one-line edit. GOTOOLCHAIN=local stays: the RC satisfies the `go 1.27` go.mod requirement on its own. The Makefile still defaults to GO ?= gotip for local development, so the CI steps pass GO=go explicitly. Verified against go1.27rc2 locally: gofmt, vet, build, `go test -race ./...`, the integration suite, the stress-tagged vet, and `make stress` all pass. Claude-Session: https://claude.ai/code/session_01LgyCGiwxZCkSXxgy3PqfPC
1 parent 420f07b commit 4e88979

2 files changed

Lines changed: 30 additions & 87 deletions

File tree

.github/workflows/ci.yml

Lines changed: 20 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ permissions:
99
contents: read
1010

1111
# cactus uses Go's built-in crypto/mldsa and declares `go 1.27` in
12-
# go.mod, so it must be built with a Go 1.27 toolchain. Until 1.27 is
13-
# released, that means the gotip 1.27-devel toolchain (the same default
14-
# the Makefile uses: GO ?= gotip). Once Go 1.27 ships, replace the
15-
# bootstrap+gotip steps with a single actions/setup-go (go-version
16-
# '1.27') and drop GOTOOLCHAIN=local.
12+
# go.mod, so it must be built with a Go 1.27 toolchain. 1.27 has not had
13+
# a final release yet, so CI pins the newest release candidate; bump
14+
# GO_VERSION as later RCs appear and set it to '1.27' once 1.27.0 ships.
15+
# GOTOOLCHAIN=local keeps the go command from downloading a different
16+
# toolchain behind our backs -- the RC satisfies the go.mod requirement
17+
# on its own.
1718
env:
19+
GO_VERSION: '1.27.0-rc.2'
1820
GOTOOLCHAIN: local
1921

2022
jobs:
@@ -23,71 +25,42 @@ jobs:
2325
steps:
2426
- uses: actions/checkout@v6
2527

26-
# A released Go is needed only to `go install` and bootstrap gotip.
27-
- name: Install bootstrap Go
28+
# setup-go caches the module and build caches itself, keyed on
29+
# go.sum, so no separate actions/cache step is needed.
30+
- name: Install Go
2831
uses: actions/setup-go@v6
2932
with:
30-
go-version: stable
31-
cache: false
32-
33-
# Cache the built gotip toolchain so we don't rebuild Go from
34-
# source on every run. Bump the -v1 suffix to force a refresh to a
35-
# newer gotip commit.
36-
- name: Cache gotip toolchain
37-
id: cache-gotip
38-
uses: actions/cache@v5
39-
with:
40-
path: |
41-
~/sdk/gotip
42-
~/go/bin/gotip
43-
key: gotip-${{ runner.os }}-v1
44-
45-
- name: Install gotip (Go 1.27 devel)
46-
if: steps.cache-gotip.outputs.cache-hit != 'true'
47-
run: |
48-
go install golang.org/dl/gotip@latest
49-
"$(go env GOPATH)/bin/gotip" download
50-
51-
- name: Put gotip on PATH
52-
run: echo "$HOME/go/bin" >> "$GITHUB_PATH"
53-
54-
# Module + build cache for faster test runs.
55-
- name: Cache Go modules and build
56-
uses: actions/cache@v5
57-
with:
58-
path: |
59-
~/.cache/go-build
60-
~/go/pkg/mod
61-
key: go-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
62-
restore-keys: go-${{ runner.os }}-
33+
go-version: ${{ env.GO_VERSION }}
6334

6435
- name: Toolchain version
65-
run: gotip version
36+
run: go version
6637

6738
- name: Check gofmt
6839
run: |
69-
fmtout=$("$(gotip env GOROOT)/bin/gofmt" -l .)
40+
fmtout=$(gofmt -l .)
7041
if [ -n "$fmtout" ]; then
7142
echo "These files are not gofmt-clean:"
7243
echo "$fmtout"
7344
exit 1
7445
fi
7546
47+
# The Makefile defaults to gotip for local development; CI has a
48+
# real 1.27 toolchain on PATH as `go`.
7649
- name: Vet
77-
run: make vet
50+
run: make GO=go vet
7851

7952
- name: Build
80-
run: make build
53+
run: make GO=go build
8154

8255
- name: Test (race)
83-
run: gotip test -race -count=1 ./...
56+
run: go test -race -count=1 ./...
8457

8558
- name: Integration tests (race)
86-
run: make integration
59+
run: make GO=go integration
8760

8861
# The stress test is build-tagged, so the steps above never compile
8962
# it. Vet it here so a break is caught on the pull request rather
9063
# than by the nightly Stress workflow. Running it is that
9164
# workflow's job.
9265
- name: Vet stress-tagged tests
93-
run: gotip vet -tags=stress ./integration/...
66+
run: go vet -tags=stress ./integration/...

.github/workflows/stress.yml

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -34,60 +34,30 @@ on:
3434
permissions:
3535
contents: read
3636

37-
# See .github/workflows/ci.yml — cactus needs a Go 1.27 toolchain, which
38-
# until 1.27 ships means gotip. Once it ships, replace the bootstrap and
39-
# gotip steps with a single actions/setup-go and drop GOTOOLCHAIN=local.
37+
# See .github/workflows/ci.yml for why this pins a 1.27 release
38+
# candidate. Keep GO_VERSION in sync with that workflow.
4039
env:
40+
GO_VERSION: '1.27.0-rc.2'
4141
GOTOOLCHAIN: local
4242

4343
jobs:
4444
stress:
4545
runs-on: ubuntu-latest
4646
# Generous: the default 800-cert run takes seconds, but a
47-
# workflow_dispatch soak can be given a much larger size, and the
48-
# first run on a cold cache has to build the gotip toolchain.
47+
# workflow_dispatch soak can be given a much larger size.
4948
timeout-minutes: 60
5049
steps:
5150
- uses: actions/checkout@v6
5251

53-
# A released Go is needed only to `go install` and bootstrap gotip.
54-
- name: Install bootstrap Go
52+
# setup-go caches the module and build caches itself, keyed on
53+
# go.sum, so no separate actions/cache step is needed.
54+
- name: Install Go
5555
uses: actions/setup-go@v6
5656
with:
57-
go-version: stable
58-
cache: false
59-
60-
# Shares a cache key with ci.yml so whichever workflow runs first
61-
# populates it for the other.
62-
- name: Cache gotip toolchain
63-
id: cache-gotip
64-
uses: actions/cache@v5
65-
with:
66-
path: |
67-
~/sdk/gotip
68-
~/go/bin/gotip
69-
key: gotip-${{ runner.os }}-v1
70-
71-
- name: Install gotip (Go 1.27 devel)
72-
if: steps.cache-gotip.outputs.cache-hit != 'true'
73-
run: |
74-
go install golang.org/dl/gotip@latest
75-
"$(go env GOPATH)/bin/gotip" download
76-
77-
- name: Put gotip on PATH
78-
run: echo "$HOME/go/bin" >> "$GITHUB_PATH"
79-
80-
- name: Cache Go modules and build
81-
uses: actions/cache@v5
82-
with:
83-
path: |
84-
~/.cache/go-build
85-
~/go/pkg/mod
86-
key: go-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
87-
restore-keys: go-${{ runner.os }}-
57+
go-version: ${{ env.GO_VERSION }}
8858

8959
- name: Toolchain version
90-
run: gotip version
60+
run: go version
9161

9262
# `make stress` runs under -race, which is the point: the
9363
# assertions this test makes about index assignment are exactly the
@@ -99,4 +69,4 @@ jobs:
9969
env:
10070
CACTUS_STRESS_CERTS: ${{ inputs.certs }}
10171
CACTUS_STRESS_CONCURRENCY: ${{ inputs.concurrency }}
102-
run: make stress
72+
run: make GO=go stress

0 commit comments

Comments
 (0)