Skip to content

Commit 7bddda5

Browse files
committed
internal/ci: assume the CI machines are reasonably modern
The Namespace runners are decently new CPUs, so bumping GOAMD64 and GOARM64 past their defaults should lead to slightly faster tests. Especially for `go test -race`, which has a build for GOAMD64=v3 which was measured to reduce the overhead of the race detector by ~15%. Given that `go test -race ./...` is by far the slowest job step, taking over 90s on Linux with Go 1.24.x, this seems worthwhile. Testing for newer architectures should not mean a loss of test coverage for the project, given that we do not write any assembly or SIMD code. Likewise, it should not cause any changes in the build artifacts generated by goreleaser, given that those use separate env vars. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I9114e480bd9f773f466a776dc20210024a4efa40 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1217817 Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Paul Jolly <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent f7e5f80 commit 7bddda5

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.github/workflows/release.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ jobs:
6262
run: |-
6363
go env -w GOTOOLCHAIN=local
6464
65+
case $(go env GOARCH) in
66+
amd64) go env -w GOAMD64=v3 ;; # 2013 and later; makes `go test -race` 15% faster
67+
arm64) go env -w GOARM64=v8.6 ;; # Apple M2 and later
68+
esac
69+
6570
# Dump env for good measure
6671
go env
6772
- name: Setup qemu

.github/workflows/trybot.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ jobs:
7575
run: |-
7676
go env -w GOTOOLCHAIN=local
7777
78+
case $(go env GOARCH) in
79+
amd64) go env -w GOAMD64=v3 ;; # 2013 and later; makes `go test -race` 15% faster
80+
arm64) go env -w GOARM64=v8.6 ;; # Apple M2 and later
81+
esac
82+
7883
# Dump env for good measure
7984
go env
8085
- if: matrix.runner != 'namespace-profile-windows-2022-amd64-8x16'

internal/ci/base/github.cue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ installGo: {
5757
run: """
5858
go env -w GOTOOLCHAIN=local
5959
60+
case $(go env GOARCH) in
61+
amd64) go env -w GOAMD64=v3 ;; # 2013 and later; makes `go test -race` 15% faster
62+
arm64) go env -w GOARM64=v8.6 ;; # Apple M2 and later
63+
esac
64+
6065
# Dump env for good measure
6166
go env
6267
"""

0 commit comments

Comments
 (0)