-
Notifications
You must be signed in to change notification settings - Fork 25
55 lines (52 loc) · 1.37 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
53
54
55
name: Go
on: [ push, pull_request ]
jobs:
test:
name: go test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.21.3'
- name: Run tests and generate coverage report
run: go test -coverprofile cover.out -covermode atomic ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./cover.out
fail_ci_if_error: true
vet:
name: go vet
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.21.3'
- uses: actions/checkout@v3
- name: go vet
run: go vet ./...
gocyclo:
name: gocyclo
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.21.3'
- name: Install gocyclo
run: go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
- uses: actions/checkout@v3
- name: gocyclo
run: gocyclo -over 38 .
staticcheck:
name: staticcheck
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.21.3'
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest
- uses: actions/checkout@v3
- name: staticcheck
run: staticcheck ./...