-
Notifications
You must be signed in to change notification settings - Fork 31
44 lines (42 loc) · 1.22 KB
/
codegen.yml
File metadata and controls
44 lines (42 loc) · 1.22 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
# All code generation should be run prior to pull request. Running it again should not produce a diff.
name: "Codegen Verifier"
on:
pull_request:
merge_group:
push:
branches:
- 'main'
- 'develop'
jobs:
codegen-verifier:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- uses: actions/checkout@v4
- name: Determine Go version
id: go_version
run: echo "GO_VERSION=$(cat go.mod |grep "^go"|cut -d' ' -f 2)" >> $GITHUB_ENV
- name: Setup Go ${{ env.GO_VERSION }}
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Display Go version
run: go version
- name: Tidy
run: make gomodtidy
- name: Install protoc
run: make install-protoc
- name: Re-Generate files
run: make generate
- name: ensure no changes
run: |
set -e
git_status=$(git status --porcelain=v1)
if [ ! -z "$git_status" ]; then
git status
git diff
echo "Error: modified files detected, run 'make gomodtidy' / 'make generate' / ."
exit 1
fi