-
Notifications
You must be signed in to change notification settings - Fork 2
140 lines (140 loc) · 3.75 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
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
on:
pull_request:
push:
branches: [main]
jobs:
pytest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build Docker image
run: docker build --pull --rm -f "appu/Dockerfile" -t appu appu/.
- name: Run tests in Docker container
run: docker run --rm appu /bin/sh -c 'pip install -r dev-requirements.txt; python -m pytest --cov profile.cov --cov-report; coveralls'
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: "^1.16"
- name: Tidy dependencies to local
run: |
go mod tidy
- name: Run tests
run: |
go test -v ./... -race -coverprofile=profile.cov
- name: Upload Coveralls
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov
check-formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check formatting
run: |
gofmt -s -e -d -l . | tee /tmp/gofmt.output && [ $(cat /tmp/gofmt.output | wc -l) -eq 0 ]
check-smells:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: "^1.16"
- name: Tidy dependencies to local
run: |
go mod tidy
- name: Check code smells
run: |
go vet ./...
check-complexity:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: "^1.16"
- name: Install gocyclo
run: |
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
- name: Check cyclomatic complexity
run: |
gocyclo -over 15 .
check-style:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: "^1.16"
- name: Install golint
run: |
go install golang.org/x/lint/golint@latest
- name: Check Style
run: |
golint ./...
check-ineffectual-assignments:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: "^1.16"
- name: Install ineffassign
run: |
go install github.com/gordonklaus/ineffassign@latest
- name: Tidy dependencies to local
run: |
go mod tidy
- name: Check ineffectual assignments
run: |
ineffassign ./...
check-spelling:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: "^1.16"
- name: Install spellchecker
run: |
go install github.com/client9/misspell/cmd/misspell@latest
- name: Check spelling
run: |
misspell -error .
staticcheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: "^1.16"
- name: Install and run staticcheck
uses: dominikh/staticcheck-action@v1.2.0
with:
version: "2022.1.1"
check-license:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check license file is present
run: |
find . -name LICENSE.md