-
Notifications
You must be signed in to change notification settings - Fork 3
54 lines (45 loc) · 1.23 KB
/
main.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
name: wampproto CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
cache: true
- run: go version
- name: Pull in all Go dependencies
run: |
go mod vendor
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest`
version: latest
# skip all additional steps
skip-pkg-cache: true
skip-build-cache: true
- name: Check that code is formatted via go fmt tool
run: |
if [ "$(gofmt -s -l . | grep -v vendor | wc -l)" -gt 0 ]; then
exit 1;
fi
- name: Check that go modules are in synced state
run: |
go mod tidy -v
if [ -n "$(git status --porcelain go.mod go.sum)" ]; then
echo "Go modules are dirty or not in a good state. Please run go mod tidy"
exit 1;
fi
- name: Run unit tests
run: |
make test