-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (39 loc) · 1.1 KB
/
generate.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
name: generate files
on:
pull_request:
branches: [ '**' ]
env:
GOPRIVATE: github.com/DIMO-Network
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
golangci:
runs-on: ubuntu-latest
name: lint
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.22.x
- name: Install mockgen
run: go install go.uber.org/mock/[email protected]
- name: Install swag
run: go install github.com/swaggo/swag/cmd/swag@latest
- name: Checkout code
uses: actions/checkout@v4
- name: go generate
run: go generate ./...
- name: generate swagger
run: swag init -g cmd/devices-api/main.go --parseDependency --parseInternal
- name: go mod tidy
run: go mod tidy
- name: go mod verify
run: go mod verify
- name: porcelain
shell: bash
run: |
dirty_files="$(git status --porcelain)"
if [[ `git status --porcelain` ]]; then
echo "The following files are dirty:"
echo "${dirty_files}"
exit 1
fi