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