Skip to content

Commit 8168020

Browse files
author
Paulo Gomes
committed
Add make verify
Signed-off-by: Paulo Gomes <[email protected]>
1 parent fda7842 commit 8168020

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

.github/workflows/build.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,5 @@ jobs:
2727
uses: ./.github/actions/run-tests
2828
env:
2929
GOPATH: /github/home/go
30-
- name: Check if working tree is dirty
31-
run: |
32-
if [[ $(git diff --stat) != '' ]]; then
33-
git --no-pager diff
34-
echo 'run make test and commit changes'
35-
exit 1
36-
fi
30+
- name: Verify
31+
run: make verify

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,15 @@ endef
254254
update-attributions:
255255
./hack/update-attributions.sh
256256

257+
verify: update-attributions fmt vet manifests api-docs
258+
ifneq (, $(shell git status --porcelain --untracked-files=no))
259+
@{ \
260+
echo "working directory is dirty:"; \
261+
git --no-pager diff; \
262+
exit 1; \
263+
}
264+
endif
265+
257266
.PHONY: help
258267
help: ## Display this help menu
259268
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

0 commit comments

Comments
 (0)