diff --git a/.github/workflows/check-actions.yaml b/.github/workflows/check-actions.yaml index 5a8d2622..325dc255 100644 --- a/.github/workflows/check-actions.yaml +++ b/.github/workflows/check-actions.yaml @@ -9,7 +9,7 @@ on: - 'release*' jobs: - check: + required: runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/codegen.yaml b/.github/workflows/codegen.yaml new file mode 100644 index 00000000..0b4d3ddd --- /dev/null +++ b/.github/workflows/codegen.yaml @@ -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 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index b2304010..1e47b0e9 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -13,7 +13,7 @@ concurrency: cancel-in-progress: true jobs: - tests: + required: runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 22c3ee7d..0b044cad 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -13,7 +13,7 @@ concurrency: cancel-in-progress: true jobs: - tests: + required: runs-on: ubuntu-latest steps: - name: Checkout diff --git a/Makefile b/Makefile index 92db77f6..44e5a773 100644 --- a/Makefile +++ b/Makefile @@ -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 # #########