Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:

strategy:
matrix:
arch:
- x64
- armv7
- aarch64
go:
- '1.13'
- '1.14'
Expand All @@ -30,18 +34,58 @@ jobs:
go-version: '${{ matrix.go }}'

- name: 'Build'
if: ${{ matrix.arch == 'x64' }}
run: go build -v ./...

- name: 'Test'
if: ${{ matrix.arch == 'x64' }}
run: go test -v ./...

- name: 'TestRace'
if: ${{ matrix.arch == 'x64' }}
run: go test -race -v ./...

- name: 'Bench'
if: ${{ matrix.arch == 'x64' }}
run: go test -run=- -bench=. -benchtime=1x -v ./...

- name: 'BenchRace'
if: ${{ matrix.arch == 'x64' }}
run: go test -run=- -bench=. -benchtime=1x -race -v ./...

- name: 'Vet'
if: ${{ matrix.arch == 'x64' }}
# -unsafeptr=false is needed because of the noescape function in bigint.go.
run: go vet -unsafeptr=false ./...

- name: 'Staticcheck'
# staticcheck requires go1.14.
if: ${{ matrix.go != '1.13' }}
if: ${{ matrix.arch == 'x64' && matrix.go != '1.13' }}
run: |
go get honnef.co/go/tools/cmd/staticcheck
staticcheck ./...

- name: 'BuildTest for armv7'
if: ${{ matrix.arch == 'armv7' }}
env:
GOARCH: arm
GOARM: 7
run: go test -c ./...

- name: 'BuildTest for aarch64'
if: ${{ matrix.arch == 'aarch64' }}
env:
GOARCH: arm64
run: go test -c ./...

- name: 'Test and Bench on ${{ matrix.arch }}'
# arch != 'x64': we already tested on x86 above.
# go != '1.13': go1.13 + arm is significantly slower, so don't run test suite.
if: ${{ matrix.arch != 'x64' && matrix.go != '1.13' }}
uses: uraimo/run-on-arch-action@v2.1.1
with:
arch: ${{ matrix.arch }}
distro: ubuntu20.04
dockerRunArgs: --mount type=bind,source="$(pwd)",target=/checkout,readonly
run: |
find /checkout -name '*.test' -type f -executable -print0 | xargs -0 -I '{}' sh -c '{} -test.run=. -test.bench=. -test.benchtime=1x -test.v'
Loading