-
Notifications
You must be signed in to change notification settings - Fork 77
78 lines (64 loc) · 2.08 KB
/
_shared-check.yaml
File metadata and controls
78 lines (64 loc) · 2.08 KB
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
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# setup global dependencies
- name: Set up go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 1.25.x
- name: Set up node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 22.x
- name: Cache node-modules for UI package
id: cache-npm
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
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: Verify API docs are up to date
run: |
make api-docs
if [ -n "$(git status --porcelain docs/)" ]; then
echo "Error: API docs are out of date!"
echo "Please run 'make api-docs' and commit the changes."
echo ""
echo "Changed files:"
git status --porcelain docs/
echo ""
echo "Diff:"
git diff docs/
exit 1
fi
- 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