diff --git a/.travis.yml b/.travis.yml index a90dc95aa4..ee18bc8467 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ jobs: - pip install --upgrade pip - make dev-env script: - - if [ $(make n-docs-diff) -ne 0 ]; then make tx-en; fi; + - if [ $(make n-docs-diff DIFF_RANGE=$TRAVIS_COMMIT_RANGE) -ne 0 ]; then make tx-en; fi; stages: - name: test-pr diff --git a/Makefile b/Makefile index b39587e61f..060655fe0f 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ SHELL:=bash OWNER:=jupyter ARCH:=$(shell uname -m) +DIFF_RANGE?=master...HEAD # Need to list the images in build dependency order ifeq ($(ARCH),ppc64le) @@ -61,10 +62,11 @@ 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}' + @git diff --name-only $(DIFF_RANGE) -- 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}' + @git diff --name-only $(DIFF_RANGE) -- ':!docs/' | wc -l | awk '{print $$1}' tx-en: ## rebuild en locale strings and push to master git config --global user.email "travis@travis-ci.org"