-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (38 loc) · 1.16 KB
/
test.yaml
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
name: build-test
on: [push]
jobs:
test:
name: build-test
strategy:
fail-fast: false
matrix:
go-version: [1.17.x, 1.18.x, 1.19.x, 1.20.x, 1.21.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Build
run: |
go env -w GOFLAGS=-mod=mod
go build -v ./...
- name: Test With Coverage
run: go test -race -coverprofile=coverage -covermode=atomic
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: ./coverage
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21.x'
- name: Go vet
run: |
go vet .
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21.x'
- name: Go Static Check
run: |
go install honnef.co/go/tools/cmd/staticcheck@latest
staticcheck .
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21.x'