Skip to content

Commit

Permalink
Fix diff comparison for master merge
Browse files Browse the repository at this point in the history
Need to check file changes in TRAVIS_COMMIT_RANGE
  • Loading branch information
parente committed May 5, 2019
1 parent 9f7046a commit 12c9b8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 12c9b8b

Please sign in to comment.