.github/workflows: update Go versions #346
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: [push, pull_request] | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
go: ['1.19.13', '1.20.14', '1.21.13', '1.22.7', '1.23.1'] | |
name: Test with Go ${{ matrix.go }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up the prerequisites | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gcc-aarch64-linux-gnu qemu-user | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Test (Linux, arm64) | |
if: runner.os == 'Linux' | |
run: | | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v fmt" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/abi" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/cpu" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/fmtsort" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/itoa" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/reflectlite" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/unsafeheader" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v math" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v math/big" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v math/bits" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v math/cmplx" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v math/rand" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v -test.short runtime" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v runtime/debug" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v runtime/internal/math" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v runtime/internal/sys" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v strconv" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v strings" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v sort" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v sync" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v sync/atomic" | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v time" | |
- name: Test (Linux, arm64, Go <=1.22) | |
if: runner.os == 'Linux' && (startsWith(matrix.go, '1.19.') || startsWith(matrix.go, '1.20.') || startsWith(matrix.go, '1.21.') || startsWith(matrix.go, '1.22.')) | |
run: | | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v runtime/internal/atomic" | |
- name: Test (Linux, arm64, Go >=1.23) | |
if: runner.os == 'Linux' && startsWith(matrix.go, '1.23.') | |
run: | | |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/runtime/atomic" | |
- name: Test (amd64) | |
run: | | |
go run test.go -args="-test.run=^Test -test.v fmt" | |
go run test.go -args="-test.run=^Test -test.v internal/abi" | |
go run test.go -args="-test.run=^Test -test.v internal/cpu" | |
go run test.go -args="-test.run=^Test -test.v internal/fmtsort" | |
go run test.go -args="-test.run=^Test -test.v internal/itoa" | |
go run test.go -args="-test.run=^Test -test.v internal/reflectlite" | |
go run test.go -args="-test.run=^Test -test.v internal/unsafeheader" | |
go run test.go -args="-test.run=^Test -test.v math" | |
go run test.go -args="-test.run=^Test -test.v math/big" | |
go run test.go -args="-test.run=^Test -test.v math/bits" | |
go run test.go -args="-test.run=^Test -test.v math/cmplx" | |
# math/rand's TestDefaultRace doesn't work well by default. | |
# Set an environment to do the default tests. | |
GO_RAND_TEST_HELPER_CODE=1 go run test.go -args="-test.run=^Test -test.v math/rand" | |
go run test.go -args="-test.run=^Test -test.v runtime/debug" | |
go run test.go -args="-test.run=^Test -test.v runtime/internal/math" | |
go run test.go -args="-test.run=^Test -test.v runtime/internal/sys" | |
go run test.go -args="-test.run=^Test -test.v strconv" | |
go run test.go -args="-test.run=^Test -test.v strings" | |
go run test.go -args="-test.run=^Test -test.v sort" | |
go run test.go -args="-test.run=^Test -test.v sync" | |
go run test.go -args="-test.run=^Test -test.v sync/atomic" | |
go run test.go -args="-test.run=^Test -test.v time" | |
- name: Test (amd64, Go <=1.22) | |
if: startsWith(matrix.go, '1.19.') || startsWith(matrix.go, '1.20.') || startsWith(matrix.go, '1.21.') || startsWith(matrix.go, '1.22.') | |
run: | | |
go run test.go -args="-test.run=^Test -test.v runtime/internal/atomic" | |
- name: Test (amd64, Go >=1.23) | |
if: startsWith(matrix.go, '1.23.') | |
run: | | |
go run test.go -args="-test.run=^Test -test.v internal/runtime/atomic" | |
- name: Test (amd64, runtime) | |
# Skip runtime tests with Go 1.19 and Windows, as there is an issue (probably golang/go#51007 and golang/go#57455). | |
if: runner.os != 'Windows' || !startsWith(matrix.go, '1.19.') | |
run: | | |
go run test.go -args="-test.run=^Test -test.v -test.short runtime" |