-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (53 loc) · 1.61 KB
/
verify.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
name: verify
on:
push:
tags:
- v*
branches:
- master
- main
pull_request:
jobs:
generate:
name: generated files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v3
with:
check-latest: true
cache: true
go-version: '1.22.0'
- run: go version
- run: go mod tidy
- run: git diff --exit-code go.mod
- name: Error message
if: ${{ failure() }}
run: echo '::error file=go.mod,line=1,col=1::Inconsistent go mod file. Ensure you have run `go mod tidy` and committed the files locally.'; echo '::error file=enterprise_mod.go,line=1,col=1::Possible missing enterprise exclusive dependencies.'
- run: make generate
- run: git diff --exit-code
- name: Error message
if: ${{ failure() }}
run: echo '::error file=Makefile,line=11,col=1::Incorrectly generated files. Ensure you have run `make generate` and committed the files locally.'
- run: make fmt
- run: git diff --exit-code
- name: Error message
if: ${{ failure() }}
run: echo 'Not formatted files. Ensure you have run `make fmt` and committed the files locally.'
linting:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.22.0'
check-latest: true
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.56.2
args:
-v
--timeout 10m