Skip to content

.github/workflows: update Go versions #326

.github/workflows: update Go versions

.github/workflows: update Go versions #326

Workflow file for this run

name: Test
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
go: ['1.19.13', '1.20.14', '1.21.12', '1.22.5']
name: Test with Go ${{ matrix.go }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v2
- 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@v3
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/atomic"
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 (amd64)
if: ${{ runner.os == 'Linux' || (runner.os == 'Windows' && !startsWith(matrix.go, '1.22.')) }}
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/atomic"
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, runtime)
# Skip runtime tests with Go 1.19 and Windows, as there is an issue (probably golang/go#51007 and golang/go#57455).
# For Go 1.22, Windows is not supported yet.
if: ${{ runner.os != 'Windows' || (!startsWith(matrix.go, '1.19.') && !startsWith(matrix.go, '1.22.')) }}
run: |
go run test.go -args="-test.run=^Test -test.v -test.short runtime"