Skip to content

Commit

Permalink
Merge pull request #110 from nvanbenschoten/nvanbenschoten/32bit
Browse files Browse the repository at this point in the history
apd: support and test 32-bit architectures and ARM architectures
  • Loading branch information
nvanbenschoten authored Jan 10, 2022
2 parents e0f373e + 9ee42c8 commit 17328c1
Show file tree
Hide file tree
Showing 4 changed files with 187 additions and 78 deletions.
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

0 comments on commit 17328c1

Please sign in to comment.