blob: addff7733479777e5b0e5fa5957e58463cf656cd [file] [log] [blame]
Brett Cannonbb09c862017-02-10 14:21:15 -08001language: c
CAM Gerlach74ae50e2019-03-18 05:44:58 -05002dist: xenial
Brett Cannonbb09c862017-02-10 14:21:15 -08003group: beta
4
Christian Heimes8adc73c2017-09-05 01:48:54 +02005# To cache doc-building dependencies and C compiler output.
6cache:
Zachary Ware7eb3f822018-02-18 10:19:37 -06007 - pip
8 - ccache
9 - directories:
10 - $HOME/multissl
Christian Heimesced9cb52018-01-16 21:02:26 +010011
12env:
13 global:
Christian Heimes06651ee2019-06-03 20:10:19 +020014 - OPENSSL=1.1.1c
Christian Heimesced9cb52018-01-16 21:02:26 +010015 - OPENSSL_DIR="$HOME/multissl/openssl/${OPENSSL}"
16 - PATH="${OPENSSL_DIR}/bin:$PATH"
INADA Naoki8ff53562018-02-10 20:35:17 +090017 # Use -O3 because we don't use debugger on Travis-CI
18 - CFLAGS="-I${OPENSSL_DIR}/include -O3"
Christian Heimesced9cb52018-01-16 21:02:26 +010019 - LDFLAGS="-L${OPENSSL_DIR}/lib"
20 # Set rpath with env var instead of -Wl,-rpath linker flag
21 # OpenSSL ignores LDFLAGS when linking bin/openssl
22 - LD_RUN_PATH="${OPENSSL_DIR}/lib"
Brett Cannonbb09c862017-02-10 14:21:15 -080023
Donald Stufft984eef72017-02-14 20:21:32 -050024branches:
25 only:
26 - master
27 - /^\d\.\d$/
Zachary Ware7eb3f822018-02-18 10:19:37 -060028 - buildbot-custom
Donald Stufft984eef72017-02-14 20:21:32 -050029
Brett Cannonbb09c862017-02-10 14:21:15 -080030matrix:
Brett Cannonb52260d2017-02-14 16:37:15 -080031 fast_finish: true
Brett Cannonbb09c862017-02-10 14:21:15 -080032 allow_failures:
Brett Cannon21c2dd72017-06-03 10:24:17 -070033 - env: OPTIONAL=true
Brett Cannonbb09c862017-02-10 14:21:15 -080034 include:
Gordon P. Hemsleyaf070c12019-05-13 00:18:20 -040035 - name: "CPython tests"
36 os: linux
Hiro Asaria5aa72a2017-05-31 18:34:00 -040037 language: c
38 compiler: clang
39 # gcc also works, but to keep the # of concurrent builds down, we use one C
Brett Cannon21c2dd72017-06-03 10:24:17 -070040 # compiler here and the other to run the coverage build. Clang is preferred
41 # in this instance for its better error messages.
42 env: TESTING=cpython
Zachary Wareb12112b2018-07-11 14:09:58 -050043 addons:
44 apt:
45 packages:
46 - xvfb
Gordon P. Hemsleyaf070c12019-05-13 00:18:20 -040047 - name: "Documentation build"
48 os: linux
Brett Cannonbb09c862017-02-10 14:21:15 -080049 language: python
Brett Cannon31b39012017-05-11 10:45:34 -070050 # 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 -070051 python: 3.6
Brett Cannon21c2dd72017-06-03 10:24:17 -070052 env: TESTING=docs
Brett Cannonbb09c862017-02-10 14:21:15 -080053 before_script:
Zachary Ware53251972017-02-15 16:18:03 -060054 - cd Doc
Mariattafca224f2017-05-16 13:48:25 -070055 # Sphinx is pinned so that new versions that introduce new warnings won't suddenly cause build failures.
56 # (Updating the version is fine as long as no warnings are raised by doing so.)
Stéphane Wirtel859c0682018-10-12 09:51:05 +020057 # The theme used by the docs is stored separately, so we need to install that as well.
Julien Palard7d23dbe2019-06-15 15:41:58 +020058 - python -m pip install sphinx==2.0.1 blurb python-docs-theme
Brett Cannonbb09c862017-02-10 14:21:15 -080059 script:
Ned Deily122fc132017-11-27 17:07:32 -050060 - make check suspicious html SPHINXOPTS="-q -W -j4"
Gordon P. Hemsleyaf070c12019-05-13 00:18:20 -040061 - name: "Documentation tests"
62 os: linux
Inada Naoki57b1a282019-04-11 17:53:49 +090063 language: c
64 compiler: clang
65 env: TESTING=doctest
66 addons:
67 apt:
68 packages:
69 - xvfb
70 before_script:
71 - ./configure
72 - make -j4
73 - make -C Doc/ PYTHON=../python venv
74 script:
75 xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W -j4" doctest
Gordon P. Hemsleyaf070c12019-05-13 00:18:20 -040076 - name: "Mac OS X tests"
77 os: osx
Antoine Pitroud7687eb2018-02-27 21:40:37 +010078 language: c
79 compiler: clang
80 # Testing under macOS is optional until testing stability has been demonstrated.
81 env: OPTIONAL=true
82 before_install:
83 # Python 3 is needed for Argument Clinic and multissl
INADA Naoki6b873992018-06-04 12:57:03 +090084 - HOMEBREW_NO_AUTO_UPDATE=1 brew install xz python3
Antoine Pitroud7687eb2018-02-27 21:40:37 +010085 - export PATH=$(brew --prefix)/bin:$(brew --prefix)/sbin:$PATH
Gordon P. Hemsleyaf070c12019-05-13 00:18:20 -040086 - name: "Test code coverage (Python)"
87 os: linux
Brett Cannonbb09c862017-02-10 14:21:15 -080088 language: c
Brett Cannonad2f9e22017-03-27 16:39:54 -070089 compiler: gcc
Brett Cannon21c2dd72017-06-03 10:24:17 -070090 env: OPTIONAL=true
Ammar Askard7da8362018-06-22 17:29:02 -040091 addons:
92 apt:
93 packages:
Zachary Wareb12112b2018-07-11 14:09:58 -050094 - xvfb
Brett Cannonbb09c862017-02-10 14:21:15 -080095 before_script:
Zachary Ware7eb3f822018-02-18 10:19:37 -060096 - ./configure
Gordon P. Hemsley87068ed2019-05-11 23:33:35 -040097 - make -j4
Zachary Ware7eb3f822018-02-18 10:19:37 -060098 # Need a venv that can parse covered code.
99 - ./python -m venv venv
100 - ./venv/bin/python -m pip install -U coverage
101 - ./venv/bin/python -m test.pythoninfo
Brett Cannonbb09c862017-02-10 14:21:15 -0800102 script:
103 # Skip tests that re-run the entire test suite.
Gordon P. Hemsley87068ed2019-05-11 23:33:35 -0400104 - xvfb-run ./venv/bin/python -m coverage run --branch --pylib -m test --fail-env-changed -uall,-cpu -x test_multiprocessing_fork -x test_multiprocessing_forkserver -x test_multiprocessing_spawn -x test_concurrent_futures || true
Brett Cannonbb09c862017-02-10 14:21:15 -0800105 after_script: # Probably should be after_success once test suite updated to run under coverage.py.
106 # Make the `coverage` command available to Codecov w/ a version of Python that can parse all source files.
107 - source ./venv/bin/activate
Gordon P. Hemsley87068ed2019-05-11 23:33:35 -0400108 - bash <(curl -s https://codecov.io/bash)
Gordon P. Hemsleyaf070c12019-05-13 00:18:20 -0400109 - name: "Test code coverage (C)"
110 os: linux
Gordon P. Hemsley87068ed2019-05-11 23:33:35 -0400111 language: c
112 compiler: gcc
113 env: OPTIONAL=true
114 addons:
115 apt:
116 packages:
117 - lcov
118 - xvfb
119 before_script:
120 - ./configure
121 script:
122 - xvfb-run make -j4 coverage-report
123 after_script: # Probably should be after_success once test suite updated to run under coverage.py.
124 - make pythoninfo
Brett Cannonbb09c862017-02-10 14:21:15 -0800125 - bash <(curl -s https://codecov.io/bash)
Brett Cannonbb09c862017-02-10 14:21:15 -0800126
Zachary Ware7eb3f822018-02-18 10:19:37 -0600127
128before_install:
129 - set -e
Berker Peksag157c0b82017-02-14 12:57:26 +0300130 - |
Zachary Ware7eb3f822018-02-18 10:19:37 -0600131 # Check short-circuit conditions
Victor Stinnera22df482018-11-28 10:24:08 +0100132 if [[ "${TESTING}" != "docs" && "${TESTING}" != "doctest" ]]
Berker Peksag157c0b82017-02-14 12:57:26 +0300133 then
Antoine Pitroud7687eb2018-02-27 21:40:37 +0100134 if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]
Zachary Ware7eb3f822018-02-18 10:19:37 -0600135 then
136 echo "Not a PR, doing full build."
137 else
138 # Pull requests are slightly complicated because $TRAVIS_COMMIT_RANGE
139 # may include more changes than desired if the history is convoluted.
140 # Instead, explicitly fetch the base branch and compare against the
141 # merge-base commit.
142 git fetch -q origin +refs/heads/$TRAVIS_BRANCH
143 changes=$(git diff --name-only HEAD $(git merge-base HEAD FETCH_HEAD))
144 echo "Files changed:"
145 echo "$changes"
146 if ! echo "$changes" | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
147 then
148 echo "Only docs were updated, stopping build process."
149 exit
150 fi
151 fi
Berker Peksag157c0b82017-02-14 12:57:26 +0300152 fi
Zachary Ware7eb3f822018-02-18 10:19:37 -0600153
154install:
155 - |
156 # Install OpenSSL as necessary
Victor Stinnera22df482018-11-28 10:24:08 +0100157 # Note: doctest needs OpenSSL
Antoine Pitroud7687eb2018-02-27 21:40:37 +0100158 if [[ "${TESTING}" != "docs" ]]
Zachary Ware7eb3f822018-02-18 10:19:37 -0600159 then
Christian Heimesced9cb52018-01-16 21:02:26 +0100160 # clang complains about unused-parameter a lot, redirect stderr
161 python3 Tools/ssl/multissltests.py --steps=library \
162 --base-directory ${HOME}/multissl \
163 --openssl ${OPENSSL} >/dev/null 2>&1
164 fi
Zachary Ware7eb3f822018-02-18 10:19:37 -0600165 - openssl version
166
167# Travis provides only 2 cores, so don't overdo the parallelism and waste memory.
168before_script:
169 - ./configure --with-pydebug
170 - make -j4 regen-all
171 - changes=`git status --porcelain`
172 - |
173 # Check for changes in regenerated files
Zachary Ware3f8f16d2017-06-10 23:04:36 -0500174 if ! test -z "$changes"
Zachary Ware0afbabe2017-06-10 21:37:40 -0500175 then
176 echo "Generated files not up to date"
Zachary Ware3f8f16d2017-06-10 23:04:36 -0500177 echo "$changes"
Zachary Ware0afbabe2017-06-10 21:37:40 -0500178 exit 1
179 fi
Zachary Ware7eb3f822018-02-18 10:19:37 -0600180 - make -j4
181 - make pythoninfo
Brett Cannonbb09c862017-02-10 14:21:15 -0800182
183script:
Brett Cannon70cb1872017-06-24 16:51:23 -0700184 # Using the built Python as patchcheck.py is built around the idea of using
185 # a checkout-build of CPython to know things like what base branch the changes
186 # should be compared against.
187 # Only run on Linux as the check only needs to be run once.
188 - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./python Tools/scripts/patchcheck.py --travis $TRAVIS_PULL_REQUEST; fi
Victor Stinner87d332d2017-10-24 01:29:53 -0700189 # Check that all symbols exported by libpython start with "Py" or "_Py"
190 - make smelly
Zachary Ware7eb3f822018-02-18 10:19:37 -0600191 # `-r -w` implicitly provided through `make buildbottest`.
Stéphane Wirtel859c0682018-10-12 09:51:05 +0200192 - |
193 if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
194 XVFB_RUN=xvfb-run;
195 fi
196 $XVFB_RUN make buildbottest TESTOPTS="-j4 -uall,-cpu"
Brett Cannonbb09c862017-02-10 14:21:15 -0800197notifications:
198 email: false
199 irc:
200 channels:
Donald Stufft4538ddc2017-02-10 19:58:34 -0500201 # This is set to a secure variable to prevent forks from notifying the
202 # IRC channel whenever they fail a build. This can be removed when travis
203 # implements https://github.com/travis-ci/travis-ci/issues/1094.
204 # The actual value here is: irc.freenode.net#python-dev
205 - 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 -0800206 on_success: change
207 on_failure: always
208 skip_join: true
Zachary Ware0bd48262018-10-20 11:35:21 -0500209 webhooks:
210 urls:
211 # For the same reasons as above for IRC, we encrypt the webhook address
212 # for Zulip. The actual value is:
213 # https://python.zulipchat.com/api/v1/external/travis?api_key=<api-key-redacted>&stream=core%2Ftest+runs
214 - secure: "vLz2TodSL7wQ8DsIu86koRS9i4dsK40PH8+wzY93PBCCAzJAz113LTxK3/9PamMv+ObDRUSe5OpXcquE3d5Gwpu8IymF113qK0I3uNr+O3FtmKlj/Kd1P/V+z4pTpS3zh3lW9gyKV9EMWXIWS0IYKKZQU144XqUlIiucWK2jHJF/cSz2cRAx/6Kx68X4mZwEC7hiMOF4ZsWUMbCglM89ybeS0pr0kK9mmh88qsPyRQov3mRKswmVPlePk7clVLNAL43qSe3SzmrmACZfQ9KJYmpYnr/cjo2b6svYHcQBAwAUarZZ9KBMXeV7HwGWsSXAvHH2ynR0P++braBHGEMTGMSitdVWzFTmeiHnrkp08WAB+uFs54iEx3VklTk9bCzozTm2S94TRxbrsG9SypMvQxG570JV6P2XYuR+taCb/GMtMqrtGQm2e1Ht+nDLtiUb+/+rwEbicJJ13knptOQZI4tPOZESI/kXkORkSNwFfLSNLSl9jTlMmO7KjAAPApURHEdx26RbItAn8mIX2NcHTRjKn2qV4h3C54nmHmKWn/ZudHHJc6ieZSEUBoaLGAYmcWJRqrM6jiy2h9I9TRrCKAiGh5jT47FYKLwosTtV245l/ZhDb6eTVfEFT6TSLEoyfx9cCtTUvfMtXYl8eN9wlFYYpH8MSWbMD14eEkKBTWg="
215 on_success: change
216 on_failure: always