-
Notifications
You must be signed in to change notification settings - Fork 21
52 lines (44 loc) · 1.4 KB
/
go.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
42
43
44
45
46
47
48
49
50
51
52
on:
push:
branches: [ main ]
pull_request:
branches: [ '**' ]
name: Go
jobs:
test:
strategy:
matrix:
go-version: [1.13.x, 1.20.x, 1.21.x, 1.22.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
exclude:
# There is no arm64 version of Go for darwin
- go-version: "1.13.x"
platform: "macos-latest"
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Ensure gofmt formatting
if: matrix.platform == 'ubuntu-latest' && startsWith(matrix.go-version, '1.22')
run: |
[ "$(gofmt -l $(find . -name '*.go') 2>&1)" = "" ]
- name: Download Go dependencies
env:
GOPROXY: "https://proxy.golang.org"
run: go mod download
- name: Test with -race
run: go test -race -count=1 ./...
- name: Integration test
if: matrix.platform == 'ubuntu-latest' && startsWith(matrix.go-version, '1.22')
run: go test -v -tags integration -exec=sudo -count=1 ./...
- name: staticcheck.io
if: matrix.platform == 'ubuntu-latest' && startsWith(matrix.go-version, '1.22')
uses: dominikh/[email protected]
with:
version: "2023.1.7"
install-go: false
cache-key: ${{ matrix.go }}