-
-
Notifications
You must be signed in to change notification settings - Fork 71
45 lines (35 loc) · 903 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
42
43
44
45
name: test
on:
pull_request:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.21.4
- name: Checkout code
uses: actions/checkout@v3
- name: go mod package cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Tests
run: go test ./...
- name: Gofumpt
run: ./bin/gofumpt -l -w . 2>&1 | tee outfile && test -z "$(cat outfile)" && rm outfile
- name: go vet
run: go vet ./...
- name: Staticcheck
run: ./bin/staticcheck ./...
- name: Vulncheck
run: ./bin/govulncheck ./...