Test on ARM
Tamir Duberstein authored 2 years ago
Tamir Duberstein committed 2 years ago
12 | 12 | runs-on: ubuntu-latest |
13 | 13 | strategy: |
14 | 14 | matrix: |
15 | arch: | |
16 | - armv6 | |
17 | - armv7 | |
18 | - aarch64 | |
19 | - x64 | |
15 | 20 | go: |
16 | - '1.3' | |
17 | - '1.4' | |
18 | 21 | - '1.5' |
19 | 22 | - '1.6' |
20 | 23 | - '1.7' |
28 | 31 | - '1.15' |
29 | 32 | - '1.16' |
30 | 33 | - '1.17' |
34 | race_build: | |
35 | - true | |
36 | include: | |
37 | - go: '1.3' | |
38 | arch: x64 | |
39 | race_build: false | |
40 | - go: '1.4' | |
41 | arch: x64 | |
42 | race_build: false | |
31 | 43 | steps: |
32 | 44 | - uses: actions/checkout@v2 |
33 | 45 | - name: Set up Go |
34 | 46 | uses: actions/setup-go@v2 |
35 | 47 | with: |
36 | go-version: '${{ matrix.go }}' | |
48 | go-version: ${{ matrix.go }} | |
37 | 49 | - name: 'Build with ${{ matrix.go }}' |
50 | if: ${{ matrix.arch == 'x64' }} | |
38 | 51 | run: go build -v ./... |
39 | 52 | - name: 'Test with ${{ matrix.go }}' |
53 | if: ${{ matrix.arch == 'x64' }} | |
40 | 54 | run: go test -v ./... |
41 | 55 | - name: 'TestRace with ${{ matrix.go }}' |
56 | if: ${{ matrix.arch == 'x64' && matrix.race_build }} | |
42 | 57 | run: go test -race -v ./... |
43 | 58 | - name: 'Bench with ${{ matrix.go }}' |
59 | if: ${{ matrix.arch == 'x64' }} | |
44 | 60 | run: go test -bench=. -benchmem -v ./... |
45 | 61 | - name: 'BenchRace with ${{ matrix.go }}' |
62 | if: ${{ matrix.arch == 'x64' && matrix.race_build }} | |
46 | 63 | run: go test -bench=. -benchmem -race -v ./... |
64 | - name: 'BuildTest with ${{ matrix.go }} for armv6' | |
65 | if: ${{ matrix.arch == 'armv6' }} | |
66 | env: | |
67 | GOARCH: arm | |
68 | GOARM: 6 | |
69 | run: go test -c ./... | |
70 | - name: 'BuildTest with ${{ matrix.go }} for armv7' | |
71 | if: ${{ matrix.arch == 'armv7' }} | |
72 | env: | |
73 | GOARCH: arm | |
74 | GOARM: 7 | |
75 | run: go test -c ./... | |
76 | - name: 'BuildTest with ${{ matrix.go }} for aarch64' | |
77 | if: ${{ matrix.arch == 'aarch64' }} | |
78 | env: | |
79 | GOARCH: arm64 | |
80 | run: go test -c ./... | |
81 | - name: 'Test and Bench with ${{ matrix.go }} on ${{ matrix.arch }}' | |
82 | if: ${{ matrix.arch != 'x64' }} | |
83 | uses: uraimo/run-on-arch-action@v2.1.1 | |
84 | with: | |
85 | arch: ${{ matrix.arch }} | |
86 | distro: bullseye | |
87 | dockerRunArgs: --mount type=bind,source="$(pwd)",target=/checkout,readonly | |
88 | run: | | |
89 | find /checkout -name '*.test' -type f -executable -exec '{}' -test.v \; | |
90 | find /checkout -name '*.test' -type f -executable -exec '{}' -test.bench=. -test.benchmem -test.v \; |