Skip to content

Commit eae3068

Browse files
authored
Merge pull request #857 from parente/smarter-builds
Build docs, images when appropriate
2 parents ae5f7e1 + f1aa698 commit eae3068

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ install:
1010
- make dev-env
1111
script:
1212
- set -e
13-
- make docs
14-
- make build-test-all DARGS="--build-arg TEST_ONLY_BUILD=1"
13+
- if [ $(make n-docs-diff) -ne 0 ]; then make docs; fi;
14+
- if [ $(make n-other-diff) -ne 0 ]; then make build-test-all DARGS="--build-arg TEST_ONLY_BUILD=1"; fi;

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ dev-env: ## install libraries required to build docs and run tests
6060
docs: ## build HTML documentation
6161
make -C docs html
6262

63+
n-docs-diff: ## number of docs/ files changed since branch from master
64+
@git diff --name-only master...HEAD -- docs/ | wc -l | awk '{print $$1}'
65+
66+
n-other-diff: ## number of files outside docs/ changed since branch from master
67+
@git diff --name-only master...HEAD -- ':!docs/' | wc -l | awk '{print $$1}'
68+
6369
test/%: ## run tests against a stack
6470
@TEST_IMAGE="$(OWNER)/$(notdir $@)" pytest test
6571

0 commit comments

Comments
 (0)