Skip to content

Commit 876de06

Browse files
committed
Add a check for consistency of generated manifests
Signed-off-by: Jonathan West <[email protected]>
1 parent e32261b commit 876de06

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/codegen.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Verify generated code is up to date
2+
on:
3+
push:
4+
branches:
5+
- '*'
6+
pull_request:
7+
branches:
8+
- '*'
9+
10+
jobs:
11+
check-go-modules:
12+
name: "Check for go.mod/go.sum synchronicity"
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
- name: Setup Golang
18+
uses: actions/setup-go@v5
19+
with:
20+
go-version-file: 'go.mod'
21+
- name: Download all Go modules
22+
run: |
23+
go mod download
24+
- name: Check for tidyness of go.mod and go.sum
25+
run: |
26+
go mod tidy
27+
git diff --exit-code -- .
28+
29+
check-sdk-codegen:
30+
name: "Check for changes from make bundle"
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v4
35+
- name: Setup Golang
36+
uses: actions/setup-go@v5
37+
with:
38+
go-version-file: 'go.mod'
39+
- name: Run make bundle
40+
run: |
41+
make bundle
42+
- name: Ensure there is no diff in bundle
43+
run: |
44+
git diff --exit-code -- .
45+
- name: Run make generate
46+
run: |
47+
make generate
48+
- name: Ensure there is no diff in generated assets
49+
run: |
50+
git diff --exit-code -- .
51+
- name: Run make manifests
52+
run: |
53+
make manifests
54+
- name: Ensure there is no diff in manifests
55+
run: |
56+
git diff --exit-code -- .

0 commit comments

Comments
 (0)