Skip to content

Commit

Permalink
build: Catch uncommitted generated files during CI
Browse files Browse the repository at this point in the history
Fixes #2355

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
  • Loading branch information
tsandall committed Apr 30, 2020
1 parent 12d1afb commit 1095b39
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ travis-go:
-w /src \
-e GOCACHE=/src/.go/cache \
golang:$(GOVERSION) \
make build-linux build-windows build-darwin go-test perf check
make build-linux build-windows build-darwin go-test perf travis-check

.PHONY: travis-check
travis-check: check
./build/check-working-copy.sh

# The travis-wasm target exists because we do not want to run the generate
# target outside of Docker. This step duplicates the the wasm-rego-test target
Expand Down
8 changes: 8 additions & 0 deletions build/check-working-copy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

if output=$(git status --porcelain) && [ -z "$output" ]; then
exit 0
else
git status
exit 1
fi

0 comments on commit 1095b39

Please sign in to comment.