github.com/cockroachdb/apd/v3@v3.2.0/.github/workflows/go.yml (about) 1 name: Go 2 3 on: 4 push: 5 branches: 6 - master 7 pull_request: 8 branches: 9 - master 10 11 jobs: 12 build: 13 runs-on: ubuntu-latest 14 15 strategy: 16 matrix: 17 arch: 18 - x64 19 - armv7 20 - aarch64 21 go: 22 - '1.13' 23 - '1.14' 24 - '1.15' 25 - '1.16' 26 - '1.17' 27 - '1.18' 28 - '1.19' 29 - '1.20' 30 31 steps: 32 - uses: actions/checkout@v2 33 34 - name: Set up Go 35 uses: actions/setup-go@v2 36 with: 37 go-version: '${{ matrix.go }}' 38 39 - name: 'Build' 40 if: ${{ matrix.arch == 'x64' }} 41 run: go build -v ./... 42 43 - name: 'Test' 44 if: ${{ matrix.arch == 'x64' }} 45 run: go test -v ./... 46 47 - name: 'TestRace' 48 if: ${{ matrix.arch == 'x64' }} 49 run: go test -race -v ./... 50 51 - name: 'Bench' 52 if: ${{ matrix.arch == 'x64' }} 53 run: go test -run=- -bench=. -benchtime=1x -v ./... 54 55 - name: 'BenchRace' 56 if: ${{ matrix.arch == 'x64' }} 57 run: go test -run=- -bench=. -benchtime=1x -race -v ./... 58 59 - name: 'Vet' 60 if: ${{ matrix.arch == 'x64' }} 61 # -unsafeptr=false is needed because of the noescape function in bigint.go. 62 run: go vet -unsafeptr=false ./... 63 64 - name: 'Staticcheck' 65 # staticcheck requires go1.19. 66 if: ${{ matrix.arch == 'x64' && matrix.go >= '1.19' }} 67 run: | 68 go install honnef.co/go/tools/cmd/staticcheck@v0.4.3 69 staticcheck ./... 70 71 - name: 'GCAssert' 72 # Only run gcassert on the latest versions of Go. Inlining heuristics 73 # change from version to version. 74 if: ${{ matrix.arch == 'x64' && matrix.go >= '1.17' }} 75 run: | 76 go install github.com/jordanlewis/gcassert/cmd/gcassert@latest 77 gcassert ./... 78 79 - name: 'BuildTest for armv7' 80 if: ${{ matrix.arch == 'armv7' }} 81 env: 82 GOARCH: arm 83 GOARM: 7 84 run: go test -c ./... 85 86 - name: 'BuildTest for aarch64' 87 if: ${{ matrix.arch == 'aarch64' }} 88 env: 89 GOARCH: arm64 90 run: go test -c ./... 91 92 - name: 'Test and Bench on ${{ matrix.arch }}' 93 # arch != 'x64': we already tested on x86 above. 94 # go != '1.13': go1.13 + arm is significantly slower, so don't run test suite. 95 if: ${{ matrix.arch != 'x64' && matrix.go != '1.13' }} 96 uses: uraimo/run-on-arch-action@v2.1.1 97 with: 98 arch: ${{ matrix.arch }} 99 distro: ubuntu20.04 100 dockerRunArgs: --mount type=bind,source="$(pwd)",target=/checkout,readonly 101 run: | 102 find /checkout -name '*.test' -type f -executable -print0 | xargs -0 -I '{}' sh -c '{} -test.run=. -test.bench=. -test.benchtime=1x -test.v'