-
Notifications
You must be signed in to change notification settings - Fork 45
77 lines (77 loc) · 1.88 KB
/
pr.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
name: PR
on:
workflow_dispatch: {}
pull_request:
branches:
- main
paths:
- "!docs/**"
- "!archive/**"
- "!custom-archive/**"
- "!tools/bin/**"
- "!**.yaml"
- "!**.md"
- "!**.txt"
- "!**.conf"
# override previous rules:
- "**.c"
- "**.h"
- "**.go"
- "**.sh"
- ".github/workflows/pr.yaml"
concurrency:
group: ${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
verify-and-test:
name: Verify and Test
runs-on: ubuntu-latest
steps:
#
- name: Checkout Code
uses: actions/checkout@v2
with:
submodules: true
#
- name: Install Dependencies
uses: ./.github/actions/build-dependencies
with:
from: pr
#
# CODE VERIFICATION
#
- name: Install staticchecker
run: |
GOROOT=/usr/local/go GOPATH=$HOME/go go install honnef.co/go/tools/cmd/staticcheck@a093f7c2d3d45d5104fb3414ae939a98be37be02 # v0.4.7
sudo cp $HOME/go/bin/staticcheck /usr/bin/
shell: bash
#
- name: Install goimports-reviser
run: |
go install github.com/incu6us/goimports-reviser/v3@38044e6cb02749195e5384d9d9535ed00a10fc1f # v3.6.4
sudo cp $HOME/go/bin/goimports-reviser /usr/bin/
shell: bash
#
- name: Lint
run: |
if test -z "$(gofmt -l .)"; then
echo "Congrats! There is nothing to fix."
else
echo "The following lines should be fixed."
gofmt -s -d .
exit 1
fi
#
- name: Check Golang Vet
run: |
make check-vet
#
- name: Check with StaticCheck
run: |
make check-staticcheck
#
# CODE TESTING
#
- name: Run Unit Tests
run: |
make test-unit