Skip to content

Commit

Permalink
chore: verify codegen (#10)
Browse files Browse the repository at this point in the history
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
  • Loading branch information
eddycharly authored Oct 3, 2023
1 parent 4aabfc4 commit 133fbaf
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- 'release*'

jobs:
check:
required:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/codegen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Verify codegen

# permissions: {}

on:
pull_request:
branches:
- 'main'
- 'release*'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
required:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Verify codegen
run: |
set -e
make verify-codegen
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:
cancel-in-progress: true

jobs:
tests:
required:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:
cancel-in-progress: true

jobs:
tests:
required:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ codegen-crds: $(CONTROLLER_GEN) ## Generate CRDs
.PHONY: codegen-all
codegen-all: codegen-crds codegen-deepcopy codegen-register ## Rebuild all generated code

.PHONY: verify-codegen
verify-codegen: codegen-all ## Verify all generated code and docs are up to date
@echo Checking codegen is up to date... >&2
@git --no-pager diff -- .
@echo 'If this test fails, it is because the git diff is non-empty after running "make codegen-all".' >&2
@echo 'To correct this, locally run "make codegen-all", commit the changes, and re-run tests.' >&2
@git diff --quiet --exit-code -- .

#########
# BUILD #
#########
Expand Down

0 comments on commit 133fbaf

Please sign in to comment.