-
Notifications
You must be signed in to change notification settings - Fork 35
42 lines (42 loc) · 1.18 KB
/
lint.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
# lint workflow runs golangci-lint, re generate swagger api and checks for any diffs
on:
push:
branches: [main]
pull_request:
name: Checks
jobs:
lint:
name: lint check
strategy:
matrix:
go-version: [1.18.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
env:
GOPATH: ${{ github.workspace }}
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Check out code
uses: actions/checkout@v2
with:
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
- uses: actions/[email protected]
with:
path: ${{ env.GOPATH }}/pkg/mod
key: ${{ runner.os }}-go-${{ github.job }}
- name: Install dependencies
run: |
make install-deps
- name: Lint check
run: |
make lint-check
- name: Swagger check
run: |
make gen-swagger
echo "Checking that swagger gen didn't result in a modified git tree" && git diff --exit-code ./http