Skip to content

Commit

Permalink
internal/ci: use GOTOOLCHAIN instead of setup-go
Browse files Browse the repository at this point in the history
DO NOT SUBMIT

Signed-off-by: Paul Jolly <[email protected]>
Change-Id: Ib48f27ef7c89e21369118bc1d92b49504931ae8b
Dispatch-Trailer: {"type":"trybot","CL":1200627,"patchset":4,"ref":"refs/changes/27/1200627/4","targetBranch":"master"}
  • Loading branch information
myitcv authored and cueckoo committed Sep 4, 2024
1 parent 46fb300 commit 062b416
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 15 additions & 15 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.22.x
- 1.23.x
- go1.22.6
- go1.23.0
runner:
- ubuntu-22.04
- macos-14
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand All @@ -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 ./...
Expand Down
16 changes: 8 additions & 8 deletions internal/ci/base/github.cue
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion internal/ci/github/release.cue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
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 @@ -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
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 @@ -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"

Expand Down

0 comments on commit 062b416

Please sign in to comment.