From 1095b391ec9b29ecce1f93be7dc4aaa3e216765d Mon Sep 17 00:00:00 2001 From: Torin Sandall Date: Thu, 30 Apr 2020 09:24:22 -0400 Subject: [PATCH] build: Catch uncommitted generated files during CI Fixes #2355 Signed-off-by: Torin Sandall --- Makefile | 6 +++++- build/check-working-copy.sh | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 build/check-working-copy.sh diff --git a/Makefile b/Makefile index 57ff778372..e6fe02483a 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/build/check-working-copy.sh b/build/check-working-copy.sh new file mode 100755 index 0000000000..b23571c094 --- /dev/null +++ b/build/check-working-copy.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +if output=$(git status --porcelain) && [ -z "$output" ]; then + exit 0 +else + git status + exit 1 +fi \ No newline at end of file