blob: 5d9f4208e0431c87226a9c278c0277a9f1cac52f [file] [log] [blame]
Brett Cannonbb09c862017-02-10 14:21:15 -08001language: c
Pablo Galindoc5fc1562020-04-22 23:29:27 +01002dist: bionic
Brett Cannonbb09c862017-02-10 14:21:15 -08003
Christian Heimes8adc73c2017-09-05 01:48:54 +02004# To cache doc-building dependencies and C compiler output.
5cache:
Zachary Ware7eb3f822018-02-18 10:19:37 -06006 - pip
7 - ccache
8 - directories:
9 - $HOME/multissl
Christian Heimesced9cb52018-01-16 21:02:26 +010010
11env:
12 global:
Victor Stinnerb1ffb8b2020-04-03 03:03:59 +020013 - OPENSSL=1.1.1f
Christian Heimesced9cb52018-01-16 21:02:26 +010014 - OPENSSL_DIR="$HOME/multissl/openssl/${OPENSSL}"
15 - PATH="${OPENSSL_DIR}/bin:$PATH"
Jeroen Demeyer667eaff2019-06-27 13:17:44 +020016 - CFLAGS="-I${OPENSSL_DIR}/include"
Christian Heimesced9cb52018-01-16 21:02:26 +010017 - LDFLAGS="-L${OPENSSL_DIR}/lib"
18 # Set rpath with env var instead of -Wl,-rpath linker flag
19 # OpenSSL ignores LDFLAGS when linking bin/openssl
20 - LD_RUN_PATH="${OPENSSL_DIR}/lib"
Brett Cannonbb09c862017-02-10 14:21:15 -080021
Donald Stufft984eef72017-02-14 20:21:32 -050022branches:
23 only:
24 - master
Anthony Sottilebba92072019-09-09 03:49:33 -070025 - /^\d\.\d+$/
Zachary Ware7eb3f822018-02-18 10:19:37 -060026 - buildbot-custom
Donald Stufft984eef72017-02-14 20:21:32 -050027
Brett Cannonbb09c862017-02-10 14:21:15 -080028matrix:
Brett Cannonb52260d2017-02-14 16:37:15 -080029 fast_finish: true
Brett Cannonbb09c862017-02-10 14:21:15 -080030 allow_failures:
Brett Cannon21c2dd72017-06-03 10:24:17 -070031 - env: OPTIONAL=true
Brett Cannonbb09c862017-02-10 14:21:15 -080032 include:
Gordon P. Hemsleyaf070c12019-05-13 00:18:20 -040033 - name: "CPython tests"
34 os: linux
Hiro Asaria5aa72a2017-05-31 18:34:00 -040035 language: c
36 compiler: clang
37 # gcc also works, but to keep the # of concurrent builds down, we use one C
Brett Cannon21c2dd72017-06-03 10:24:17 -070038 # compiler here and the other to run the coverage build. Clang is preferred
39 # in this instance for its better error messages.
40 env: TESTING=cpython
Zachary Wareb12112b2018-07-11 14:09:58 -050041 addons:
42 apt:
43 packages:
Jeroen Demeyer667eaff2019-06-27 13:17:44 +020044 - gdb
Zachary Wareb12112b2018-07-11 14:09:58 -050045 - xvfb
Gordon P. Hemsleyaf070c12019-05-13 00:18:20 -040046 - name: "Documentation build"
47 os: linux
Brett Cannonbb09c862017-02-10 14:21:15 -080048 language: python
Brett Cannon31b39012017-05-11 10:45:34 -070049 # 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 -070050 python: 3.6
Brett Cannon21c2dd72017-06-03 10:24:17 -070051 env: TESTING=docs
Brett Cannonbb09c862017-02-10 14:21:15 -080052 before_script:
Zachary Ware53251972017-02-15 16:18:03 -060053 - cd Doc
Victor Stinner9e73cac2020-09-18 16:53:46 +020054 - make venv PYTHON=python
Brett Cannonbb09c862017-02-10 14:21:15 -080055 script:
Ned Deily122fc132017-11-27 17:07:32 -050056 - make check suspicious html SPHINXOPTS="-q -W -j4"
Gordon P. Hemsleyaf070c12019-05-13 00:18:20 -040057 - name: "Documentation tests"
58 os: linux
Inada Naoki57b1a282019-04-11 17:53:49 +090059 language: c
60 compiler: clang
61 env: TESTING=doctest
62 addons:
63 apt:
64 packages:
65 - xvfb
66 before_script:
67 - ./configure
68 - make -j4
69 - make -C Doc/ PYTHON=../python venv
70 script:
71 xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W -j4" doctest
Gordon P. Hemsleyaf070c12019-05-13 00:18:20 -040072 - name: "Test code coverage (Python)"
73 os: linux
Brett Cannonbb09c862017-02-10 14:21:15 -080074 language: c
Brett Cannonad2f9e22017-03-27 16:39:54 -070075 compiler: gcc
Brett Cannon21c2dd72017-06-03 10:24:17 -070076 env: OPTIONAL=true
Ammar Askard7da8362018-06-22 17:29:02 -040077 addons:
78 apt:
79 packages:
Zachary Wareb12112b2018-07-11 14:09:58 -050080 - xvfb
Brett Cannonbb09c862017-02-10 14:21:15 -080081 before_script:
Miss Islington (bot)3cf80942020-06-16 08:47:16 -070082 - |
83 if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]
84 then
85 echo "Don't run Python coverage on pull requests."
86 exit
87 fi
Zachary Ware7eb3f822018-02-18 10:19:37 -060088 - ./configure
Gordon P. Hemsley87068ed2019-05-11 23:33:35 -040089 - make -j4
Zachary Ware7eb3f822018-02-18 10:19:37 -060090 # Need a venv that can parse covered code.
91 - ./python -m venv venv
92 - ./venv/bin/python -m pip install -U coverage
Paul Ganssle62972d92020-05-16 04:20:06 -040093 - ./venv/bin/python -m pip install -r Misc/requirements-test.txt
Zachary Ware7eb3f822018-02-18 10:19:37 -060094 - ./venv/bin/python -m test.pythoninfo
Brett Cannonbb09c862017-02-10 14:21:15 -080095 script:
96 # Skip tests that re-run the entire test suite.
Gordon P. Hemsley87068ed2019-05-11 23:33:35 -040097 - 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 -080098 after_script: # Probably should be after_success once test suite updated to run under coverage.py.
99 # Make the `coverage` command available to Codecov w/ a version of Python that can parse all source files.
100 - source ./venv/bin/activate
Ammar Askar766b7542020-02-27 18:08:30 -0500101 - bash <(curl -s https://codecov.io/bash) -y .github/codecov.yml
Gordon P. Hemsleyaf070c12019-05-13 00:18:20 -0400102 - name: "Test code coverage (C)"
103 os: linux
Gordon P. Hemsley87068ed2019-05-11 23:33:35 -0400104 language: c
105 compiler: gcc
106 env: OPTIONAL=true
107 addons:
108 apt:
109 packages:
110 - lcov
111 - xvfb
112 before_script:
Miss Islington (bot)3cf80942020-06-16 08:47:16 -0700113 - |
114 if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]
115 then
116 echo "Don't run C coverage on pull requests."
117 exit
118 fi
Gordon P. Hemsley87068ed2019-05-11 23:33:35 -0400119 - ./configure
120 script:
121 - xvfb-run make -j4 coverage-report
122 after_script: # Probably should be after_success once test suite updated to run under coverage.py.
123 - make pythoninfo
Ammar Askar766b7542020-02-27 18:08:30 -0500124 - bash <(curl -s https://codecov.io/bash) -y .github/codecov.yml
Brett Cannonbb09c862017-02-10 14:21:15 -0800125
Zachary Ware7eb3f822018-02-18 10:19:37 -0600126
127before_install:
128 - set -e
Berker Peksag157c0b82017-02-14 12:57:26 +0300129 - |
Zachary Ware7eb3f822018-02-18 10:19:37 -0600130 # Check short-circuit conditions
Victor Stinnera22df482018-11-28 10:24:08 +0100131 if [[ "${TESTING}" != "docs" && "${TESTING}" != "doctest" ]]
Berker Peksag157c0b82017-02-14 12:57:26 +0300132 then
Antoine Pitroud7687eb2018-02-27 21:40:37 +0100133 if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]
Zachary Ware7eb3f822018-02-18 10:19:37 -0600134 then
135 echo "Not a PR, doing full build."
136 else
137 # Pull requests are slightly complicated because $TRAVIS_COMMIT_RANGE
138 # may include more changes than desired if the history is convoluted.
139 # Instead, explicitly fetch the base branch and compare against the
140 # merge-base commit.
141 git fetch -q origin +refs/heads/$TRAVIS_BRANCH
142 changes=$(git diff --name-only HEAD $(git merge-base HEAD FETCH_HEAD))
143 echo "Files changed:"
144 echo "$changes"
145 if ! echo "$changes" | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
146 then
147 echo "Only docs were updated, stopping build process."
148 exit
149 fi
150 fi
Berker Peksag157c0b82017-02-14 12:57:26 +0300151 fi
Zachary Ware7eb3f822018-02-18 10:19:37 -0600152
153install:
154 - |
155 # Install OpenSSL as necessary
Victor Stinnera22df482018-11-28 10:24:08 +0100156 # Note: doctest needs OpenSSL
Antoine Pitroud7687eb2018-02-27 21:40:37 +0100157 if [[ "${TESTING}" != "docs" ]]
Zachary Ware7eb3f822018-02-18 10:19:37 -0600158 then
Christian Heimesced9cb52018-01-16 21:02:26 +0100159 # clang complains about unused-parameter a lot, redirect stderr
160 python3 Tools/ssl/multissltests.py --steps=library \
161 --base-directory ${HOME}/multissl \
162 --openssl ${OPENSSL} >/dev/null 2>&1
163 fi
Zachary Ware7eb3f822018-02-18 10:19:37 -0600164 - openssl version
165
166# Travis provides only 2 cores, so don't overdo the parallelism and waste memory.
167before_script:
Inada Naoki21cfae12019-06-28 02:05:37 +0900168 # -Og is much faster than -O0
169 - CFLAGS="${CFLAGS} -Og" ./configure --with-pydebug
Pablo Galindoc5fc1562020-04-22 23:29:27 +0100170 - eval "$(pyenv init -)"
171 - pyenv global 3.8
172 - PYTHON_FOR_REGEN=python3.8 make -j4 regen-all
Zachary Ware7eb3f822018-02-18 10:19:37 -0600173 - changes=`git status --porcelain`
174 - |
175 # Check for changes in regenerated files
Zachary Ware3f8f16d2017-06-10 23:04:36 -0500176 if ! test -z "$changes"
Zachary Ware0afbabe2017-06-10 21:37:40 -0500177 then
178 echo "Generated files not up to date"
Zachary Ware3f8f16d2017-06-10 23:04:36 -0500179 echo "$changes"
Zachary Ware0afbabe2017-06-10 21:37:40 -0500180 exit 1
181 fi
Zachary Ware7eb3f822018-02-18 10:19:37 -0600182 - make -j4
183 - make pythoninfo
Brett Cannonbb09c862017-02-10 14:21:15 -0800184
185script:
Brett Cannon70cb1872017-06-24 16:51:23 -0700186 # Using the built Python as patchcheck.py is built around the idea of using
187 # a checkout-build of CPython to know things like what base branch the changes
188 # should be compared against.
189 # Only run on Linux as the check only needs to be run once.
190 - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./python Tools/scripts/patchcheck.py --travis $TRAVIS_PULL_REQUEST; fi
Victor Stinner87d332d2017-10-24 01:29:53 -0700191 # Check that all symbols exported by libpython start with "Py" or "_Py"
192 - make smelly
Zachary Ware7eb3f822018-02-18 10:19:37 -0600193 # `-r -w` implicitly provided through `make buildbottest`.
Stéphane Wirtel859c0682018-10-12 09:51:05 +0200194 - |
195 if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
196 XVFB_RUN=xvfb-run;
197 fi
198 $XVFB_RUN make buildbottest TESTOPTS="-j4 -uall,-cpu"
Brett Cannonbb09c862017-02-10 14:21:15 -0800199notifications:
200 email: false
201 irc:
202 channels:
Donald Stufft4538ddc2017-02-10 19:58:34 -0500203 # This is set to a secure variable to prevent forks from notifying the
204 # IRC channel whenever they fail a build. This can be removed when travis
205 # implements https://github.com/travis-ci/travis-ci/issues/1094.
206 # The actual value here is: irc.freenode.net#python-dev
207 - 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 -0800208 on_success: change
209 on_failure: always
210 skip_join: true
Zachary Ware0bd48262018-10-20 11:35:21 -0500211 webhooks:
212 urls:
213 # For the same reasons as above for IRC, we encrypt the webhook address
214 # for Zulip. The actual value is:
215 # https://python.zulipchat.com/api/v1/external/travis?api_key=<api-key-redacted>&stream=core%2Ftest+runs
216 - secure: "vLz2TodSL7wQ8DsIu86koRS9i4dsK40PH8+wzY93PBCCAzJAz113LTxK3/9PamMv+ObDRUSe5OpXcquE3d5Gwpu8IymF113qK0I3uNr+O3FtmKlj/Kd1P/V+z4pTpS3zh3lW9gyKV9EMWXIWS0IYKKZQU144XqUlIiucWK2jHJF/cSz2cRAx/6Kx68X4mZwEC7hiMOF4ZsWUMbCglM89ybeS0pr0kK9mmh88qsPyRQov3mRKswmVPlePk7clVLNAL43qSe3SzmrmACZfQ9KJYmpYnr/cjo2b6svYHcQBAwAUarZZ9KBMXeV7HwGWsSXAvHH2ynR0P++braBHGEMTGMSitdVWzFTmeiHnrkp08WAB+uFs54iEx3VklTk9bCzozTm2S94TRxbrsG9SypMvQxG570JV6P2XYuR+taCb/GMtMqrtGQm2e1Ht+nDLtiUb+/+rwEbicJJ13knptOQZI4tPOZESI/kXkORkSNwFfLSNLSl9jTlMmO7KjAAPApURHEdx26RbItAn8mIX2NcHTRjKn2qV4h3C54nmHmKWn/ZudHHJc6ieZSEUBoaLGAYmcWJRqrM6jiy2h9I9TRrCKAiGh5jT47FYKLwosTtV245l/ZhDb6eTVfEFT6TSLEoyfx9cCtTUvfMtXYl8eN9wlFYYpH8MSWbMD14eEkKBTWg="
217 on_success: change
218 on_failure: always