diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2017-02-14 09:57:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-14 09:57:26 (GMT) |
commit | 157c0b86b805a6a27b44efd4bf168a66e60ecf18 (patch) | |
tree | 188c3215c184d61d1b2c489207343567f47840a5 /.travis.yml | |
parent | 22ba52b8431ecfc9c07926c8b245733a638c347f (diff) | |
download | cpython-157c0b86b805a6a27b44efd4bf168a66e60ecf18.zip cpython-157c0b86b805a6a27b44efd4bf168a66e60ecf18.tar.gz cpython-157c0b86b805a6a27b44efd4bf168a66e60ecf18.tar.bz2 |
Only run CI checks when appropriate files have changed (#74)
Closes python/core-workflow#14
Diffstat (limited to '.travis.yml')
-rw-r--r-- | .travis.yml | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/.travis.yml b/.travis.yml index 90d19d3..8721922 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,8 +30,14 @@ matrix: env: - TESTING=docs before_script: - - cd Doc - - make venv PYTHON=python3 + - | + if git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '^Doc/' + then + echo "Docs weren't updated, stopping build process." + exit + fi + cd Doc + make venv PYTHON=python3 script: - make html SPHINXBUILD="./venv/bin/python3 -m sphinx" SPHINXOPTS="-q" - python3 tools/rstlint.py -i tools -i venv @@ -41,11 +47,17 @@ matrix: env: - TESTING=coverage before_script: - - ./configure - - make -s -j4 - # Need a venv that can parse covered code. - - ./python -m venv venv - - ./venv/bin/python -m pip install -U coverage + - | + if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.(rst|yml)$)|(^Doc)/' + then + echo "Only docs were updated, stopping build process." + exit + fi + ./configure + make -s -j4 + # Need a venv that can parse covered code. + ./python -m venv venv + ./venv/bin/python -m pip install -U coverage script: # Skip tests that re-run the entire test suite. - ./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: # Travis provides only 2 cores, so don't overdue the parallelism and waste memory. before_script: - - ./configure --with-pydebug - - make -j4 + - | + if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.(rst|yml)$)|(^Doc)/' + then + echo "Only docs were updated, stopping build process." + exit + fi + ./configure --with-pydebug + make -j4 script: # `-r -w` implicitly provided through `make buildbottest`. |