-
Notifications
You must be signed in to change notification settings - Fork 30
63 lines (50 loc) · 1.46 KB
/
_shared-check.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
name: Reusable check workflow
on:
workflow_call:
# shared check jobs
jobs:
check_source:
name: Run code checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# setup global dependencies
- name: Set up go
uses: actions/setup-go@v4
with:
go-version: 1.23.x
- name: Set up node
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Cache node-modules for UI package
id: cache-npm
uses: actions/cache@v3
with:
path: ./ui-package/node_modules
key: uipackage-npm-${{ runner.os }}-${{ hashFiles('./ui-package/package-lock.json') }}
restore-keys: |
uipackage-npm-${{ runner.os }}-
uipackage-npm-
- name: Prepare test environment
run: mkdir -p ui-package/dist && touch ui-package/dist/dummy
- name: Verify dependencies
run: go mod verify
- name: Run go vet
run: go vet ./...
- name: Check go fmt
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest
- name: Run staticcheck
run: staticcheck ./...
#- name: Install golint
# run: go install golang.org/x/lint/golint@latest
#- name: Run golint
# run: golint ./...
- name: Run tests
run: go test -race -vet=off ./...
# build UI package
- name: Build UI package
run: |
make build-ui