File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 2
2
set -e
3
3
set -x
4
4
5
+ # Short circuit tests and linting jobs if there are no code changes involved.
6
+ if [[ $TOXENV != docs ]]; then
7
+ if [[ " $TRAVIS_PULL_REQUEST " == " false" ]]
8
+ then
9
+ echo " This is not a PR -- will do a complete build."
10
+ else
11
+ # Pull requests are slightly complicated because $TRAVIS_COMMIT_RANGE
12
+ # may include more changes than desired if the history is convoluted.
13
+ # Instead, explicitly fetch the base branch and compare against the
14
+ # merge-base commit.
15
+ git fetch -q origin +refs/heads/$TRAVIS_BRANCH
16
+ changes=$( git diff --name-only HEAD $( git merge-base HEAD FETCH_HEAD) )
17
+ echo " Files changed:"
18
+ echo " $changes "
19
+ if ! echo " $changes " | grep -qvE ' (\.rst$)|(^docs)|(^news)|(^\.github)'
20
+ then
21
+ echo " Only Documentation was updated -- skipping build."
22
+ exit
23
+ fi
24
+ fi
25
+ fi
26
+
5
27
if [[ $TOXENV == py* ]]; then
6
28
# Run unit tests
7
29
tox -- -m unit
You can’t perform that action at this time.
0 commit comments