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