Brett Cannon | bb09c86 | 2017-02-10 14:21:15 -0800 | [diff] [blame] | 1 | language: c |
CAM Gerlach | 74ae50e | 2019-03-18 05:44:58 -0500 | [diff] [blame] | 2 | dist: xenial |
Brett Cannon | bb09c86 | 2017-02-10 14:21:15 -0800 | [diff] [blame] | 3 | group: beta |
| 4 | |
Christian Heimes | 8adc73c | 2017-09-05 01:48:54 +0200 | [diff] [blame] | 5 | # To cache doc-building dependencies and C compiler output. |
| 6 | cache: |
Zachary Ware | 7eb3f82 | 2018-02-18 10:19:37 -0600 | [diff] [blame] | 7 | - pip |
| 8 | - ccache |
| 9 | - directories: |
| 10 | - $HOME/multissl |
Christian Heimes | ced9cb5 | 2018-01-16 21:02:26 +0100 | [diff] [blame] | 11 | |
| 12 | env: |
| 13 | global: |
Christian Heimes | 58ab134 | 2019-09-11 18:45:52 +0200 | [diff] [blame] | 14 | - OPENSSL=1.1.1d |
Christian Heimes | ced9cb5 | 2018-01-16 21:02:26 +0100 | [diff] [blame] | 15 | - OPENSSL_DIR="$HOME/multissl/openssl/${OPENSSL}" |
| 16 | - PATH="${OPENSSL_DIR}/bin:$PATH" |
Jeroen Demeyer | 667eaff | 2019-06-27 13:17:44 +0200 | [diff] [blame] | 17 | - CFLAGS="-I${OPENSSL_DIR}/include" |
Christian Heimes | ced9cb5 | 2018-01-16 21:02:26 +0100 | [diff] [blame] | 18 | - LDFLAGS="-L${OPENSSL_DIR}/lib" |
| 19 | # Set rpath with env var instead of -Wl,-rpath linker flag |
| 20 | # OpenSSL ignores LDFLAGS when linking bin/openssl |
| 21 | - LD_RUN_PATH="${OPENSSL_DIR}/lib" |
Brett Cannon | bb09c86 | 2017-02-10 14:21:15 -0800 | [diff] [blame] | 22 | |
Donald Stufft | 984eef7 | 2017-02-14 20:21:32 -0500 | [diff] [blame] | 23 | branches: |
| 24 | only: |
| 25 | - master |
Anthony Sottile | bba9207 | 2019-09-09 03:49:33 -0700 | [diff] [blame] | 26 | - /^\d\.\d+$/ |
Zachary Ware | 7eb3f82 | 2018-02-18 10:19:37 -0600 | [diff] [blame] | 27 | - buildbot-custom |
Donald Stufft | 984eef7 | 2017-02-14 20:21:32 -0500 | [diff] [blame] | 28 | |
Brett Cannon | bb09c86 | 2017-02-10 14:21:15 -0800 | [diff] [blame] | 29 | matrix: |
Brett Cannon | b52260d | 2017-02-14 16:37:15 -0800 | [diff] [blame] | 30 | fast_finish: true |
Brett Cannon | bb09c86 | 2017-02-10 14:21:15 -0800 | [diff] [blame] | 31 | allow_failures: |
Brett Cannon | 21c2dd7 | 2017-06-03 10:24:17 -0700 | [diff] [blame] | 32 | - env: OPTIONAL=true |
Brett Cannon | bb09c86 | 2017-02-10 14:21:15 -0800 | [diff] [blame] | 33 | include: |
Gordon P. Hemsley | af070c1 | 2019-05-13 00:18:20 -0400 | [diff] [blame] | 34 | - name: "CPython tests" |
| 35 | os: linux |
Hiro Asari | a5aa72a | 2017-05-31 18:34:00 -0400 | [diff] [blame] | 36 | language: c |
| 37 | compiler: clang |
| 38 | # gcc also works, but to keep the # of concurrent builds down, we use one C |
Brett Cannon | 21c2dd7 | 2017-06-03 10:24:17 -0700 | [diff] [blame] | 39 | # compiler here and the other to run the coverage build. Clang is preferred |
| 40 | # in this instance for its better error messages. |
| 41 | env: TESTING=cpython |
Zachary Ware | b12112b | 2018-07-11 14:09:58 -0500 | [diff] [blame] | 42 | addons: |
| 43 | apt: |
| 44 | packages: |
Jeroen Demeyer | 667eaff | 2019-06-27 13:17:44 +0200 | [diff] [blame] | 45 | - gdb |
Zachary Ware | b12112b | 2018-07-11 14:09:58 -0500 | [diff] [blame] | 46 | - xvfb |
Gordon P. Hemsley | af070c1 | 2019-05-13 00:18:20 -0400 | [diff] [blame] | 47 | - name: "Documentation build" |
| 48 | os: linux |
Brett Cannon | bb09c86 | 2017-02-10 14:21:15 -0800 | [diff] [blame] | 49 | language: python |
Brett Cannon | 31b3901 | 2017-05-11 10:45:34 -0700 | [diff] [blame] | 50 | # Build the docs against a stable version of Python so code bugs don't hold up doc-related PRs. |
Brett Cannon | ad2f9e2 | 2017-03-27 16:39:54 -0700 | [diff] [blame] | 51 | python: 3.6 |
Brett Cannon | 21c2dd7 | 2017-06-03 10:24:17 -0700 | [diff] [blame] | 52 | env: TESTING=docs |
Brett Cannon | bb09c86 | 2017-02-10 14:21:15 -0800 | [diff] [blame] | 53 | before_script: |
Zachary Ware | 5325197 | 2017-02-15 16:18:03 -0600 | [diff] [blame] | 54 | - cd Doc |
Mariatta | fca224f | 2017-05-16 13:48:25 -0700 | [diff] [blame] | 55 | # 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 Wirtel | 859c068 | 2018-10-12 09:51:05 +0200 | [diff] [blame] | 57 | # The theme used by the docs is stored separately, so we need to install that as well. |
Julien Palard | 7d23dbe | 2019-06-15 15:41:58 +0200 | [diff] [blame] | 58 | - python -m pip install sphinx==2.0.1 blurb python-docs-theme |
Brett Cannon | bb09c86 | 2017-02-10 14:21:15 -0800 | [diff] [blame] | 59 | script: |
Ned Deily | 122fc13 | 2017-11-27 17:07:32 -0500 | [diff] [blame] | 60 | - make check suspicious html SPHINXOPTS="-q -W -j4" |
Gordon P. Hemsley | af070c1 | 2019-05-13 00:18:20 -0400 | [diff] [blame] | 61 | - name: "Documentation tests" |
| 62 | os: linux |
Inada Naoki | 57b1a28 | 2019-04-11 17:53:49 +0900 | [diff] [blame] | 63 | 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. Hemsley | af070c1 | 2019-05-13 00:18:20 -0400 | [diff] [blame] | 76 | - name: "Test code coverage (Python)" |
| 77 | os: linux |
Brett Cannon | bb09c86 | 2017-02-10 14:21:15 -0800 | [diff] [blame] | 78 | language: c |
Brett Cannon | ad2f9e2 | 2017-03-27 16:39:54 -0700 | [diff] [blame] | 79 | compiler: gcc |
Brett Cannon | 21c2dd7 | 2017-06-03 10:24:17 -0700 | [diff] [blame] | 80 | env: OPTIONAL=true |
Ammar Askar | d7da836 | 2018-06-22 17:29:02 -0400 | [diff] [blame] | 81 | addons: |
| 82 | apt: |
| 83 | packages: |
Zachary Ware | b12112b | 2018-07-11 14:09:58 -0500 | [diff] [blame] | 84 | - xvfb |
Brett Cannon | bb09c86 | 2017-02-10 14:21:15 -0800 | [diff] [blame] | 85 | before_script: |
Zachary Ware | 7eb3f82 | 2018-02-18 10:19:37 -0600 | [diff] [blame] | 86 | - ./configure |
Gordon P. Hemsley | 87068ed | 2019-05-11 23:33:35 -0400 | [diff] [blame] | 87 | - make -j4 |
Zachary Ware | 7eb3f82 | 2018-02-18 10:19:37 -0600 | [diff] [blame] | 88 | # Need a venv that can parse covered code. |
| 89 | - ./python -m venv venv |
| 90 | - ./venv/bin/python -m pip install -U coverage |
| 91 | - ./venv/bin/python -m test.pythoninfo |
Brett Cannon | bb09c86 | 2017-02-10 14:21:15 -0800 | [diff] [blame] | 92 | script: |
| 93 | # Skip tests that re-run the entire test suite. |
Gordon P. Hemsley | 87068ed | 2019-05-11 23:33:35 -0400 | [diff] [blame] | 94 | - 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 Cannon | bb09c86 | 2017-02-10 14:21:15 -0800 | [diff] [blame] | 95 | after_script: # Probably should be after_success once test suite updated to run under coverage.py. |
| 96 | # Make the `coverage` command available to Codecov w/ a version of Python that can parse all source files. |
| 97 | - source ./venv/bin/activate |
Gordon P. Hemsley | 87068ed | 2019-05-11 23:33:35 -0400 | [diff] [blame] | 98 | - bash <(curl -s https://codecov.io/bash) |
Gordon P. Hemsley | af070c1 | 2019-05-13 00:18:20 -0400 | [diff] [blame] | 99 | - name: "Test code coverage (C)" |
| 100 | os: linux |
Gordon P. Hemsley | 87068ed | 2019-05-11 23:33:35 -0400 | [diff] [blame] | 101 | language: c |
| 102 | compiler: gcc |
| 103 | env: OPTIONAL=true |
| 104 | addons: |
| 105 | apt: |
| 106 | packages: |
| 107 | - lcov |
| 108 | - xvfb |
| 109 | before_script: |
| 110 | - ./configure |
| 111 | script: |
| 112 | - xvfb-run make -j4 coverage-report |
| 113 | after_script: # Probably should be after_success once test suite updated to run under coverage.py. |
| 114 | - make pythoninfo |
Brett Cannon | bb09c86 | 2017-02-10 14:21:15 -0800 | [diff] [blame] | 115 | - bash <(curl -s https://codecov.io/bash) |
Brett Cannon | bb09c86 | 2017-02-10 14:21:15 -0800 | [diff] [blame] | 116 | |
Zachary Ware | 7eb3f82 | 2018-02-18 10:19:37 -0600 | [diff] [blame] | 117 | |
| 118 | before_install: |
| 119 | - set -e |
Berker Peksag | 157c0b8 | 2017-02-14 12:57:26 +0300 | [diff] [blame] | 120 | - | |
Zachary Ware | 7eb3f82 | 2018-02-18 10:19:37 -0600 | [diff] [blame] | 121 | # Check short-circuit conditions |
Victor Stinner | a22df48 | 2018-11-28 10:24:08 +0100 | [diff] [blame] | 122 | if [[ "${TESTING}" != "docs" && "${TESTING}" != "doctest" ]] |
Berker Peksag | 157c0b8 | 2017-02-14 12:57:26 +0300 | [diff] [blame] | 123 | then |
Antoine Pitrou | d7687eb | 2018-02-27 21:40:37 +0100 | [diff] [blame] | 124 | if [[ "$TRAVIS_PULL_REQUEST" == "false" ]] |
Zachary Ware | 7eb3f82 | 2018-02-18 10:19:37 -0600 | [diff] [blame] | 125 | then |
| 126 | echo "Not a PR, doing full build." |
| 127 | else |
| 128 | # Pull requests are slightly complicated because $TRAVIS_COMMIT_RANGE |
| 129 | # may include more changes than desired if the history is convoluted. |
| 130 | # Instead, explicitly fetch the base branch and compare against the |
| 131 | # merge-base commit. |
| 132 | git fetch -q origin +refs/heads/$TRAVIS_BRANCH |
| 133 | changes=$(git diff --name-only HEAD $(git merge-base HEAD FETCH_HEAD)) |
| 134 | echo "Files changed:" |
| 135 | echo "$changes" |
| 136 | if ! echo "$changes" | grep -qvE '(\.rst$)|(^Doc)|(^Misc)' |
| 137 | then |
| 138 | echo "Only docs were updated, stopping build process." |
| 139 | exit |
| 140 | fi |
| 141 | fi |
Berker Peksag | 157c0b8 | 2017-02-14 12:57:26 +0300 | [diff] [blame] | 142 | fi |
Zachary Ware | 7eb3f82 | 2018-02-18 10:19:37 -0600 | [diff] [blame] | 143 | |
| 144 | install: |
| 145 | - | |
| 146 | # Install OpenSSL as necessary |
Victor Stinner | a22df48 | 2018-11-28 10:24:08 +0100 | [diff] [blame] | 147 | # Note: doctest needs OpenSSL |
Antoine Pitrou | d7687eb | 2018-02-27 21:40:37 +0100 | [diff] [blame] | 148 | if [[ "${TESTING}" != "docs" ]] |
Zachary Ware | 7eb3f82 | 2018-02-18 10:19:37 -0600 | [diff] [blame] | 149 | then |
Christian Heimes | ced9cb5 | 2018-01-16 21:02:26 +0100 | [diff] [blame] | 150 | # clang complains about unused-parameter a lot, redirect stderr |
| 151 | python3 Tools/ssl/multissltests.py --steps=library \ |
| 152 | --base-directory ${HOME}/multissl \ |
| 153 | --openssl ${OPENSSL} >/dev/null 2>&1 |
| 154 | fi |
Zachary Ware | 7eb3f82 | 2018-02-18 10:19:37 -0600 | [diff] [blame] | 155 | - openssl version |
| 156 | |
| 157 | # Travis provides only 2 cores, so don't overdo the parallelism and waste memory. |
| 158 | before_script: |
Inada Naoki | 21cfae1 | 2019-06-28 02:05:37 +0900 | [diff] [blame] | 159 | # -Og is much faster than -O0 |
| 160 | - CFLAGS="${CFLAGS} -Og" ./configure --with-pydebug |
Zachary Ware | 7eb3f82 | 2018-02-18 10:19:37 -0600 | [diff] [blame] | 161 | - make -j4 regen-all |
| 162 | - changes=`git status --porcelain` |
| 163 | - | |
| 164 | # Check for changes in regenerated files |
Zachary Ware | 3f8f16d | 2017-06-10 23:04:36 -0500 | [diff] [blame] | 165 | if ! test -z "$changes" |
Zachary Ware | 0afbabe | 2017-06-10 21:37:40 -0500 | [diff] [blame] | 166 | then |
| 167 | echo "Generated files not up to date" |
Zachary Ware | 3f8f16d | 2017-06-10 23:04:36 -0500 | [diff] [blame] | 168 | echo "$changes" |
Zachary Ware | 0afbabe | 2017-06-10 21:37:40 -0500 | [diff] [blame] | 169 | exit 1 |
| 170 | fi |
Zachary Ware | 7eb3f82 | 2018-02-18 10:19:37 -0600 | [diff] [blame] | 171 | - make -j4 |
| 172 | - make pythoninfo |
Brett Cannon | bb09c86 | 2017-02-10 14:21:15 -0800 | [diff] [blame] | 173 | |
| 174 | script: |
Brett Cannon | 70cb187 | 2017-06-24 16:51:23 -0700 | [diff] [blame] | 175 | # Using the built Python as patchcheck.py is built around the idea of using |
| 176 | # a checkout-build of CPython to know things like what base branch the changes |
| 177 | # should be compared against. |
| 178 | # Only run on Linux as the check only needs to be run once. |
| 179 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./python Tools/scripts/patchcheck.py --travis $TRAVIS_PULL_REQUEST; fi |
Victor Stinner | 87d332d | 2017-10-24 01:29:53 -0700 | [diff] [blame] | 180 | # Check that all symbols exported by libpython start with "Py" or "_Py" |
| 181 | - make smelly |
Zachary Ware | 7eb3f82 | 2018-02-18 10:19:37 -0600 | [diff] [blame] | 182 | # `-r -w` implicitly provided through `make buildbottest`. |
Stéphane Wirtel | 859c068 | 2018-10-12 09:51:05 +0200 | [diff] [blame] | 183 | - | |
| 184 | if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then |
| 185 | XVFB_RUN=xvfb-run; |
| 186 | fi |
| 187 | $XVFB_RUN make buildbottest TESTOPTS="-j4 -uall,-cpu" |
Brett Cannon | bb09c86 | 2017-02-10 14:21:15 -0800 | [diff] [blame] | 188 | notifications: |
| 189 | email: false |
| 190 | irc: |
| 191 | channels: |
Donald Stufft | 4538ddc | 2017-02-10 19:58:34 -0500 | [diff] [blame] | 192 | # This is set to a secure variable to prevent forks from notifying the |
| 193 | # IRC channel whenever they fail a build. This can be removed when travis |
| 194 | # implements https://github.com/travis-ci/travis-ci/issues/1094. |
| 195 | # The actual value here is: irc.freenode.net#python-dev |
| 196 | - secure: "s7kAkpcom2yUJ8XqyjFI0obJmhAGrn1xmoivdaPdgBIA++X47TBp1x4pgDsbEsoalef7bEwa4l07KdT4qa+DOd/c4QxaWom7fbN3BuLVsZuVfODnl79+gYq/TAbGfyH+yDs18DXrUfPgwD7C5aW32ugsqAOd4iWzfGJQ5OrOZzqzGjYdYQUEkJFXgxDEIb4aHvxNDWGO3Po9uKISrhb5saQ0l776yLo1Ur7M4oxl8RTbCdgX0vf5TzPg52BgvZpOgt3DHOUYPeiJLKNjAE6ibg0U95sEvMfHX77nz4aFY4/3UI6FFaRla34rZ+mYKrn0TdxOhera1QOgPmM6HzdO4K44FpfK1DS0Xxk9U9/uApq+cG0bU3W+cVUHDBe5+90lpRBAXHeHCgT7TI8gec614aiT8lEr3+yH8OBRYGzkjNK8E2LJZ/SxnVxDe7aLF6AWcoWLfS6/ziAIBFQ5Nc4U72CT8fGVSkl8ywPiRlvixKdvTODMSZo0jMqlfZSNaAPTsNRx4wu5Uis4qekwe32Fz4aB6KGpsuuVjBi+H6v0RKxNJNGY3JKDiEH2TK0UE2auJ5GvLW48aUVFcQMB7euCWYXlSWVRHh3WLU8QXF29Dw4JduRZqUpOdRgMHU79UHRq+mkE0jAS/nBcS6CvsmxCpTSrfVYuMOu32yt18QQoTyU=" |
Brett Cannon | bb09c86 | 2017-02-10 14:21:15 -0800 | [diff] [blame] | 197 | on_success: change |
| 198 | on_failure: always |
| 199 | skip_join: true |
Zachary Ware | 0bd4826 | 2018-10-20 11:35:21 -0500 | [diff] [blame] | 200 | webhooks: |
| 201 | urls: |
| 202 | # For the same reasons as above for IRC, we encrypt the webhook address |
| 203 | # for Zulip. The actual value is: |
| 204 | # https://python.zulipchat.com/api/v1/external/travis?api_key=<api-key-redacted>&stream=core%2Ftest+runs |
| 205 | - secure: "vLz2TodSL7wQ8DsIu86koRS9i4dsK40PH8+wzY93PBCCAzJAz113LTxK3/9PamMv+ObDRUSe5OpXcquE3d5Gwpu8IymF113qK0I3uNr+O3FtmKlj/Kd1P/V+z4pTpS3zh3lW9gyKV9EMWXIWS0IYKKZQU144XqUlIiucWK2jHJF/cSz2cRAx/6Kx68X4mZwEC7hiMOF4ZsWUMbCglM89ybeS0pr0kK9mmh88qsPyRQov3mRKswmVPlePk7clVLNAL43qSe3SzmrmACZfQ9KJYmpYnr/cjo2b6svYHcQBAwAUarZZ9KBMXeV7HwGWsSXAvHH2ynR0P++braBHGEMTGMSitdVWzFTmeiHnrkp08WAB+uFs54iEx3VklTk9bCzozTm2S94TRxbrsG9SypMvQxG570JV6P2XYuR+taCb/GMtMqrtGQm2e1Ht+nDLtiUb+/+rwEbicJJ13knptOQZI4tPOZESI/kXkORkSNwFfLSNLSl9jTlMmO7KjAAPApURHEdx26RbItAn8mIX2NcHTRjKn2qV4h3C54nmHmKWn/ZudHHJc6ieZSEUBoaLGAYmcWJRqrM6jiy2h9I9TRrCKAiGh5jT47FYKLwosTtV245l/ZhDb6eTVfEFT6TSLEoyfx9cCtTUvfMtXYl8eN9wlFYYpH8MSWbMD14eEkKBTWg=" |
| 206 | on_success: change |
| 207 | on_failure: always |