blob: c4ae89cc2f5efce98771a1042936cf3b668e1c6d [file] [log] [blame]
Brett Cannonbb09c862017-02-10 14:21:15 -08001language: c
2dist: trusty
3sudo: false
4group: beta
5
Christian Heimes8adc73c2017-09-05 01:48:54 +02006# To cache doc-building dependencies and C compiler output.
7cache:
8 - pip
9 - ccache
Brett Cannonbb09c862017-02-10 14:21:15 -080010
Donald Stufft984eef72017-02-14 20:21:32 -050011branches:
12 only:
13 - master
14 - /^\d\.\d$/
15
Brett Cannonbb09c862017-02-10 14:21:15 -080016matrix:
Brett Cannonb52260d2017-02-14 16:37:15 -080017 fast_finish: true
Brett Cannonbb09c862017-02-10 14:21:15 -080018 allow_failures:
Brett Cannon21c2dd72017-06-03 10:24:17 -070019 - env: OPTIONAL=true
Brett Cannonbb09c862017-02-10 14:21:15 -080020 include:
21 - os: linux
Hiro Asaria5aa72a2017-05-31 18:34:00 -040022 language: c
23 compiler: clang
24 # gcc also works, but to keep the # of concurrent builds down, we use one C
Brett Cannon21c2dd72017-06-03 10:24:17 -070025 # compiler here and the other to run the coverage build. Clang is preferred
26 # in this instance for its better error messages.
27 env: TESTING=cpython
28 - os: osx
29 language: c
30 compiler: clang
31 # Testing under macOS is optional until testing stability has been demonstrated.
32 env: OPTIONAL=true
Zachary Ware167e0fc2017-06-05 19:11:29 -050033 before_install:
34 - brew install openssl xz
35 - export CPPFLAGS="-I$(brew --prefix openssl)/include"
36 - export LDFLAGS="-L$(brew --prefix openssl)/lib"
Hiro Asaria5aa72a2017-05-31 18:34:00 -040037 - os: linux
Brett Cannonbb09c862017-02-10 14:21:15 -080038 language: python
Brett Cannon31b39012017-05-11 10:45:34 -070039 # Build the docs against a stable version of Python so code bugs don't hold up doc-related PRs.
Brett Cannonad2f9e22017-03-27 16:39:54 -070040 python: 3.6
Brett Cannon21c2dd72017-06-03 10:24:17 -070041 env: TESTING=docs
Brett Cannonbb09c862017-02-10 14:21:15 -080042 before_script:
Zachary Ware53251972017-02-15 16:18:03 -060043 - cd Doc
Mariattafca224f2017-05-16 13:48:25 -070044 # Sphinx is pinned so that new versions that introduce new warnings won't suddenly cause build failures.
45 # (Updating the version is fine as long as no warnings are raised by doing so.)
Ned Deilyfcd97d42017-09-05 00:10:31 -070046 - python -m pip install sphinx~=1.6.1 blurb
Brett Cannonbb09c862017-02-10 14:21:15 -080047 script:
Antoine Pitroueba68e22017-05-29 12:05:45 +020048 - make check suspicious html SPHINXOPTS="-q -W -j4"
Brett Cannonbb09c862017-02-10 14:21:15 -080049 - os: linux
50 language: c
Brett Cannonad2f9e22017-03-27 16:39:54 -070051 compiler: gcc
Brett Cannon21c2dd72017-06-03 10:24:17 -070052 env: OPTIONAL=true
Brett Cannonbb09c862017-02-10 14:21:15 -080053 before_script:
Berker Peksag157c0b82017-02-14 12:57:26 +030054 - |
Zachary Warec53b13b2017-06-05 18:42:17 -050055 if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
Berker Peksag157c0b82017-02-14 12:57:26 +030056 then
57 echo "Only docs were updated, stopping build process."
58 exit
59 fi
60 ./configure
61 make -s -j4
62 # Need a venv that can parse covered code.
63 ./python -m venv venv
64 ./venv/bin/python -m pip install -U coverage
Victor Stinnerb907abc2017-08-17 16:40:51 +020065 ./venv/bin/python -m test.pythoninfo
Brett Cannonbb09c862017-02-10 14:21:15 -080066 script:
67 # Skip tests that re-run the entire test suite.
Victor Stinner5b392bb2017-07-20 15:46:32 +020068 - ./venv/bin/python -m coverage run --pylib -m test -uall,-cpu -x test_multiprocessing_fork -x test_multiprocessing_forkserver -x test_multiprocessing_spawn
Brett Cannonbb09c862017-02-10 14:21:15 -080069 after_script: # Probably should be after_success once test suite updated to run under coverage.py.
70 # Make the `coverage` command available to Codecov w/ a version of Python that can parse all source files.
71 - source ./venv/bin/activate
72 - bash <(curl -s https://codecov.io/bash)
Brett Cannonbb09c862017-02-10 14:21:15 -080073
Zachary Warec53b13b2017-06-05 18:42:17 -050074# Travis provides only 2 cores, so don't overdo the parallelism and waste memory.
Brett Cannonbb09c862017-02-10 14:21:15 -080075before_script:
Berker Peksag157c0b82017-02-14 12:57:26 +030076 - |
Zachary Ware0afbabe2017-06-10 21:37:40 -050077 set -e
Zachary Warec53b13b2017-06-05 18:42:17 -050078 if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
Berker Peksag157c0b82017-02-14 12:57:26 +030079 then
80 echo "Only docs were updated, stopping build process."
81 exit
82 fi
83 ./configure --with-pydebug
84 make -j4
Zachary Ware0afbabe2017-06-10 21:37:40 -050085 make -j4 regen-all clinic
Zachary Ware3f8f16d2017-06-10 23:04:36 -050086 changes=`git status --porcelain`
87 if ! test -z "$changes"
Zachary Ware0afbabe2017-06-10 21:37:40 -050088 then
89 echo "Generated files not up to date"
Zachary Ware3f8f16d2017-06-10 23:04:36 -050090 echo "$changes"
Zachary Ware0afbabe2017-06-10 21:37:40 -050091 exit 1
92 fi
Victor Stinner92b1f902017-08-18 17:30:51 +020093 make pythoninfo
Brett Cannonbb09c862017-02-10 14:21:15 -080094
95script:
Brett Cannon70cb1872017-06-24 16:51:23 -070096 # Using the built Python as patchcheck.py is built around the idea of using
97 # a checkout-build of CPython to know things like what base branch the changes
98 # should be compared against.
99 # Only run on Linux as the check only needs to be run once.
100 - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./python Tools/scripts/patchcheck.py --travis $TRAVIS_PULL_REQUEST; fi
Brett Cannonbb09c862017-02-10 14:21:15 -0800101 # `-r -w` implicitly provided through `make buildbottest`.
Victor Stinner5b392bb2017-07-20 15:46:32 +0200102 - make buildbottest TESTOPTS="-j4 -uall,-cpu"
Brett Cannonbb09c862017-02-10 14:21:15 -0800103
104notifications:
105 email: false
106 irc:
107 channels:
Donald Stufft4538ddc2017-02-10 19:58:34 -0500108 # This is set to a secure variable to prevent forks from notifying the
109 # IRC channel whenever they fail a build. This can be removed when travis
110 # implements https://github.com/travis-ci/travis-ci/issues/1094.
111 # The actual value here is: irc.freenode.net#python-dev
112 - secure: "s7kAkpcom2yUJ8XqyjFI0obJmhAGrn1xmoivdaPdgBIA++X47TBp1x4pgDsbEsoalef7bEwa4l07KdT4qa+DOd/c4QxaWom7fbN3BuLVsZuVfODnl79+gYq/TAbGfyH+yDs18DXrUfPgwD7C5aW32ugsqAOd4iWzfGJQ5OrOZzqzGjYdYQUEkJFXgxDEIb4aHvxNDWGO3Po9uKISrhb5saQ0l776yLo1Ur7M4oxl8RTbCdgX0vf5TzPg52BgvZpOgt3DHOUYPeiJLKNjAE6ibg0U95sEvMfHX77nz4aFY4/3UI6FFaRla34rZ+mYKrn0TdxOhera1QOgPmM6HzdO4K44FpfK1DS0Xxk9U9/uApq+cG0bU3W+cVUHDBe5+90lpRBAXHeHCgT7TI8gec614aiT8lEr3+yH8OBRYGzkjNK8E2LJZ/SxnVxDe7aLF6AWcoWLfS6/ziAIBFQ5Nc4U72CT8fGVSkl8ywPiRlvixKdvTODMSZo0jMqlfZSNaAPTsNRx4wu5Uis4qekwe32Fz4aB6KGpsuuVjBi+H6v0RKxNJNGY3JKDiEH2TK0UE2auJ5GvLW48aUVFcQMB7euCWYXlSWVRHh3WLU8QXF29Dw4JduRZqUpOdRgMHU79UHRq+mkE0jAS/nBcS6CvsmxCpTSrfVYuMOu32yt18QQoTyU="
Brett Cannonbb09c862017-02-10 14:21:15 -0800113 on_success: change
114 on_failure: always
115 skip_join: true