-
Notifications
You must be signed in to change notification settings - Fork 52
41 lines (39 loc) · 1.06 KB
/
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:
pull_request:
paths: ['**.go', 'go.mod', '.github/workflows/*']
push:
branches: ['main']
jobs:
test:
strategy:
fail-fast: false
matrix:
os: ['macos-12', 'macos-latest']
go: ['1.17', '1.22']
runs-on: '${{ matrix.os }}'
steps:
- uses: 'actions/checkout@v4'
- uses: 'actions/setup-go@v5'
with:
go-version: '${{ matrix.go }}'
- name: 'test'
run: 'go test --race ./...'
staticcheck:
name: 'staticcheck'
runs-on: 'macos-latest'
steps:
- uses: 'actions/checkout@v4'
- uses: 'actions/setup-go@v5'
with:
go-version: '1.22'
- uses: 'actions/cache@v4'
with:
key: '${{ runner.os }}-staticcheck'
path: |
${{ runner.temp }}/staticcheck
${{ steps.install_go.outputs.GOCACHE || '' }}
- run: |
export STATICCHECK_CACHE="${{ runner.temp }}/staticcheck"
go install honnef.co/go/tools/cmd/staticcheck@latest
$(go env GOPATH)/bin/staticcheck ./...