-
Notifications
You must be signed in to change notification settings - Fork 12
41 lines (34 loc) · 951 Bytes
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Test
on:
push:
branches: [main]
pull_request:
branches: ['*']
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.21.x', '1.20.x']
arch: ['amd64', '386', 'arm64']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
cache: true
# GH runners use amd64 which also support 386.
# For other architectures, use qemu.
- name: Install QEMU
if: matrix.arch != 'amd64' && matrix.arch != '386'
uses: docker/setup-qemu-action@v3
- name: Test ${{ matrix.arch }}
run: make test
env:
GOARCH: ${{ matrix.arch }}
# Only amd64/arm64 support RACE, disable it on all other architectures.
NO_RACE: ${{ (matrix.arch == 'amd64' || matrix.arch == 'arm64') && '' || '1' }}