-
Notifications
You must be signed in to change notification settings - Fork 81
36 lines (36 loc) · 994 Bytes
/
main.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
on: [push, pull_request]
name: Test
jobs:
test:
strategy:
matrix:
go-version: [1.20.x, 1.x]
os: [ubuntu-latest, windows-latest]
arch: ["", "386"]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
- name: Check formatting
run: diff -u <(echo -n) <(gofmt -d .)
if: runner.os != 'Windows'
- name: Run go vet
env:
GOARCH: ${{ matrix.arch }}
run: go vet ./...
- name: Run staticcheck
uses: dominikh/[email protected]
with:
version: "2023.1.6"
install-go: false
cache-key: ${{ matrix.go-version }}
if: ${{ matrix.go-version == '1.x' }}
- name: Run tests
env:
GOARCH: ${{ matrix.arch }}
run: go test -vet=off ./...