Skip to content

Commit

Permalink
Makefile: add 'verify-generate' target.
Browse files Browse the repository at this point in the history
Add target for verifying that all generated artifacts are up to
date in the repo. Hook it in to the top-level verify target, so
it will be run as part of our github CI workflows.

Signed-off-by: Krisztian Litkey <[email protected]>
  • Loading branch information
klihub committed Jan 12, 2024
1 parent 14450cd commit 3478c11
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ allclean: clean clean-cache

test: test-gopkgs

verify: verify-godeps verify-fmt
verify: verify-godeps verify-fmt verify-generate

#
# build targets
Expand Down Expand Up @@ -372,6 +372,17 @@ verify-fmt:
exit 1; \
fi

verify-generate: generate
$(Q) git diff --quiet; ec="$$?"; \
if [ "$$ec" != "0" ]; then \
echo "ERROR: generated artifacts are not up-to-date."; \
echo "ERROR:"; \
git --no-pager diff | sed 's/^/ERROR: /g'; \
echo "ERROR:"; \
echo "ERROR: please run 'make generate' and commit these changes."; \
exit "$$ec"; \
fi

#
# targets for installing dependencies
#
Expand Down

0 comments on commit 3478c11

Please sign in to comment.