Skip to content

Commit 6475d73

Browse files
berkerpeksagmethane
authored andcommitted
Only run CI checks when appropriate files have changed (#74)
Closes python/core-workflow#14
1 parent 8eaa1d0 commit 6475d73

File tree

1 file changed

+27
-9
lines changed

1 file changed

+27
-9
lines changed

.travis.yml

+27-9
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,14 @@ matrix:
3030
env:
3131
- TESTING=docs
3232
before_script:
33-
- cd Doc
34-
- make venv PYTHON=python3
33+
- |
34+
if git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '^Doc/'
35+
then
36+
echo "Docs weren't updated, stopping build process."
37+
exit
38+
fi
39+
cd Doc
40+
make venv PYTHON=python3
3541
script:
3642
- make html SPHINXBUILD="./venv/bin/python3 -m sphinx" SPHINXOPTS="-q"
3743
- python3 tools/rstlint.py -i tools -i venv
@@ -41,11 +47,17 @@ matrix:
4147
env:
4248
- TESTING=coverage
4349
before_script:
44-
- ./configure
45-
- make -s -j4
46-
# Need a venv that can parse covered code.
47-
- ./python -m venv venv
48-
- ./venv/bin/python -m pip install -U coverage
50+
- |
51+
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.(rst|yml)$)|(^Doc)/'
52+
then
53+
echo "Only docs were updated, stopping build process."
54+
exit
55+
fi
56+
./configure
57+
make -s -j4
58+
# Need a venv that can parse covered code.
59+
./python -m venv venv
60+
./venv/bin/python -m pip install -U coverage
4961
script:
5062
# Skip tests that re-run the entire test suite.
5163
- ./venv/bin/python -m coverage run --pylib -m test -uall -x test_multiprocessing_fork -x test_multiprocessing_forkserver -x test_multiprocessing_spawn
@@ -65,8 +77,14 @@ matrix:
6577

6678
# Travis provides only 2 cores, so don't overdue the parallelism and waste memory.
6779
before_script:
68-
- ./configure --with-pydebug
69-
- make -j4
80+
- |
81+
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.(rst|yml)$)|(^Doc)/'
82+
then
83+
echo "Only docs were updated, stopping build process."
84+
exit
85+
fi
86+
./configure --with-pydebug
87+
make -j4
7088
7189
script:
7290
# `-r -w` implicitly provided through `make buildbottest`.

0 commit comments

Comments
 (0)