This repository has been archived by the owner on Apr 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
86 lines (66 loc) · 2.43 KB
/
ci.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Continuous Integration
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up go environment
uses: actions/setup-go@v2
with:
go-version: 1.15.7
- name: Environment information
run: |
echo "UNAME: $(uname -a)"
echo "PWD: $(pwd)"
echo "PATH: ${PATH}"
echo "GO: $(go version)"
echo "GO ENV: $(go env)"
- name: Build
run: go build -v
- name: Test
run: go test -run '(Test|Example)' -race -coverprofile=coverage.out -covermode=atomic ./...
- name: Verify dependencies have expected content
run: go mod verify
- name: Code quality (revive)
run: |
go install github.com/mgechev/revive
revive -formatter friendly -exclude vendor/... ./...
- name: Code quality (formatting)
run: (gofmt -s -l -d -e $(find . -type f -name '*.go' -not -path "./vendor/*") | tee /dev/stderr) || exit 1;
- name: Code quality (vet)
run: go vet ./...
- name: Code quality (bounded cyclomatic complexity)
run: |
go install github.com/fzipp/gocyclo/cmd/gocyclo
gocyclo -over 15 $(find . -type f -name '*.go' -not -path "./vendor/*")
- name: Code quality (golint style mistakes)
run: |
go install golang.org/x/lint/golint
golint -set_exit_status $(go list ./...)
- name: Code quality (detect ineffectual assignments)
run: |
go install github.com/gordonklaus/ineffassign
ineffassign .
- name: Code quality (spelling mistakes)
run: |
go install github.com/client9/misspell/cmd/misspell
misspell --error $(find . -type f -not -path "./vendor/*" -not -path "./.git/*")
- name: Code quality (bugs, suggest code simplifications, point out dead code, and more)
run: |
go install honnef.co/go/tools/cmd/staticcheck
staticcheck -checks=all ./...
- name: Code quality (identify unnecessary type conversions)
run: |
go install github.com/mdempsky/unconvert
unconvert -v ./...
- name: Analyze binary size
run: |
go install github.com/jondot/goweight
goweight
- name: Notify Go Report Card
run: curl -XPOST https://goreportcard.com/checks -F 'repo=github.com/bpicode/fritzctl'
- name: Upload code coverage
run: bash <(curl -s https://codecov.io/bash)