Skip to content

Commit

Permalink
Add a CI step to verify config/ folder sync
Browse files Browse the repository at this point in the history
Add a make rule to verify `make manifests` has been run after every
change to the CRDs.

Signed-off-by: Andrea Panattoni <[email protected]>
  • Loading branch information
zeeke committed May 30, 2024
1 parent e42991c commit aa21f55
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ jobs:
- name: check go modules are up to date
run: make check-deps

manifests:
name: check manifests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: check if the config/ folder is up to date
run: make check-manifests

golangci:
name: Golangci-lint
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ manifests: controller-gen
$(CONTROLLER_GEN) $(CRD_OPTIONS) webhook paths="./..." output:crd:artifacts:config=$(CRD_BASES)
cp ./config/crd/bases/* ./deployment/sriov-network-operator/crds/

check-manifests: manifests
@set +e; git diff --quiet config; \
if [ $$? -eq 1 ]; \
then echo -e "\n`config` folder is out of date. Please run `make manifests` and commit your changes"; \
exit 1; fi

sync-manifests-%: manifests
@mkdir -p manifests/$*
Expand Down

0 comments on commit aa21f55

Please sign in to comment.