From f1aa69898b1a5e8b2b45aed2dec85dc82fd0a911 Mon Sep 17 00:00:00 2001 From: Peter Parente Date: Sat, 27 Apr 2019 22:57:13 -0400 Subject: [PATCH] Build docs, images when appropriate --- .travis.yml | 4 ++-- Makefile | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e0e2d48a6e..10bcd3bbfa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,5 +10,5 @@ install: - make dev-env script: - set -e - - make docs - - make build-test-all DARGS="--build-arg TEST_ONLY_BUILD=1" + - if [ $(make n-docs-diff) -ne 0 ]; then make docs; fi; + - if [ $(make n-other-diff) -ne 0 ]; then make build-test-all DARGS="--build-arg TEST_ONLY_BUILD=1"; fi; \ No newline at end of file diff --git a/Makefile b/Makefile index ff75d0582e..a7947cd25c 100644 --- a/Makefile +++ b/Makefile @@ -60,6 +60,12 @@ dev-env: ## install libraries required to build docs and run tests docs: ## build HTML documentation make -C docs html +n-docs-diff: ## number of docs/ files changed since branch from master + @git diff --name-only master...HEAD -- docs/ | wc -l | awk '{print $$1}' + +n-other-diff: ## number of files outside docs/ changed since branch from master + @git diff --name-only master...HEAD -- ':!docs/' | wc -l | awk '{print $$1}' + test/%: ## run tests against a stack @TEST_IMAGE="$(OWNER)/$(notdir $@)" pytest test