-
Notifications
You must be signed in to change notification settings - Fork 320
81 lines (75 loc) · 2.71 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: verify
on:
push:
tags:
- v*
branches:
- master
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
generate:
name: Correct generated files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- 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 mocks
- 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 mocks` and committed the files locally.'
- name: install protoc compiler
uses: arduino/setup-protoc@v3
with:
version: '25.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: make proto
- run: git diff -I '^\/\/\s+-?\s+protoc\s+v' --exit-code ## Ignore protoc version comment
- name: Error message
if: ${{ failure() }}
run: echo 'proto files are not generated correctly. Ensure you have run `make proto` and committed the files locally.'
- run: git checkout proto ## cleanup tree due to protoc version comment
- 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.'
- name: Validate OpenAPI definition
uses: char0n/swagger-editor-validate@v1
with:
definition-file: gateway/openapi.yaml
- name: Login to Docker Hub
uses: docker/login-action@v3.3.0
with:
username: rudderlabs
password: ${{ secrets.DOCKERHUB_TOKEN }}
- run: make generate-openapi-spec
- run: git diff --exit-code
- name: Error message
if: ${{ failure() }}
run: echo 'Not correctly generated openapi spec. Ensure you have run `make generate-openapi-spec` and committed the files locally.'
linting:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.62.0
args: -v