From b330463662825a7d7b22efabb2b7a40640d2b18e Mon Sep 17 00:00:00 2001 From: Joseph Richey Date: Sun, 11 Feb 2018 21:22:53 -0800 Subject: travis: use multiple build stages This change rewrites .travis.yml to use many build stages/jobs. This allows our build to run faster, as almost all jobs run in containers. Stage 1: Run on all pushes to all branches - Job Build: just runs "make" to make sure everything is OK Stage 2: Run on all PRs and pushes to master - Job Lint: Makes sure dep, "make gen", "make format", and "make lint" are all happy. - Job Build 1: Make sure "go get" and "make" will work. This job will later run unit tests. - Job Build 2: Same as Job Build 1, except with another go version. - Job Integeration: Run integration tests (needs sudo, so needs VM) Stage 3: Run on releases (if other stages pass) - Job Deploy: Publishes amd64 binaries to GitHub. --- bin/files-changed | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 bin/files-changed (limited to 'bin') diff --git a/bin/files-changed b/bin/files-changed new file mode 100755 index 0000000..3ffbad6 --- /dev/null +++ b/bin/files-changed @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# Detect if any files have changed in the git repository. Output an appropriate +# error message if they have changed. + +if [[ -n $(git status -s) ]]; then + git diff --minimal HEAD + echo + echo "**************************************************" + case "$1" in + "proto") + echo "* .pb.go files and .proto files are out of sync. *" + echo "* Run \"make gen\" to generate them. *" + ;; + "format") + echo "* C or Go files have incorrect formatting. *" + echo "* Run \"make format\" to fix them. *" + ;; + *) + echo "* Files have changed in this repository. *" + ;; + esac + echo "**************************************************" + git reset HEAD --hard + exit 1 +fi \ No newline at end of file -- cgit v1.2.3