Run tests on 386, arm, and arm64 via qemu
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 606cf83..ce531fb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml
@@ -28,5 +28,30 @@ - name: Test with -tags purego run: go test -count 1 -bench . -benchtime 1x -tags purego ./... -# TODO: Test on other architectures. Unfortunately only amd64 is supported -# by GH Actions. We could use QEMU in the meantime. + test-qemu: + needs: test + strategy: + matrix: + go-version: [1.16.x, 1.17.x] + arch: [386, arm, arm64] + runs-on: ubuntu-latest + + steps: + - name: Install go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + + - name: Install QEMU + uses: docker/setup-qemu-action@v1 + + - name: Check out code + uses: actions/checkout@v2 + + - name: Run test via qemu/binfmt + # TODO: We only run the main tests, not the ones in dynamic/, because + # that would require cgo. If we want to test dynamic linking with other + # arches, we probably will need fuller emulation, not qemu user mode. + run: go test -v -count 1 -bench . -benchtime 1x + env: + GOARCH: ${{ matrix.arch }}
diff --git a/dynamic/plugin.go b/dynamic/plugin.go index 319ed71..ed98769 100644 --- a/dynamic/plugin.go +++ b/dynamic/plugin.go
@@ -12,7 +12,7 @@ const ( in = "Call me Ishmael. Some years ago--never mind how long precisely-" - want = 0x02a2e85470d6fd96 + want = uint64(0x02a2e85470d6fd96) ) func TestSum(t *testing.T) {