blob: fc128751cb2a124951b0dce6e6e7010e4d0dbde3 [file] [log] [blame]
Brett Cannonbb09c862017-02-10 14:21:15 -08001language: c
2dist: trusty
3sudo: false
4group: beta
5
Christian Heimes8adc73c2017-09-05 01:48:54 +02006# To cache doc-building dependencies and C compiler output.
7cache:
Zachary Ware7eb3f822018-02-18 10:19:37 -06008 - pip
9 - ccache
10 - directories:
11 - $HOME/multissl
Christian Heimesced9cb52018-01-16 21:02:26 +010012
13env:
14 global:
Christian Heimese8eb6cb2018-05-22 22:50:12 +020015 - OPENSSL=1.1.0h
Christian Heimesced9cb52018-01-16 21:02:26 +010016 - OPENSSL_DIR="$HOME/multissl/openssl/${OPENSSL}"
17 - PATH="${OPENSSL_DIR}/bin:$PATH"
INADA Naoki8ff53562018-02-10 20:35:17 +090018 # Use -O3 because we don't use debugger on Travis-CI
19 - CFLAGS="-I${OPENSSL_DIR}/include -O3"
Christian Heimesced9cb52018-01-16 21:02:26 +010020 - 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 Cannonbb09c862017-02-10 14:21:15 -080024
Donald Stufft984eef72017-02-14 20:21:32 -050025branches:
26 only:
27 - master
28 - /^\d\.\d$/
Zachary Ware7eb3f822018-02-18 10:19:37 -060029 - buildbot-custom
Donald Stufft984eef72017-02-14 20:21:32 -050030
Brett Cannonbb09c862017-02-10 14:21:15 -080031matrix:
Brett Cannonb52260d2017-02-14 16:37:15 -080032 fast_finish: true
Brett Cannonbb09c862017-02-10 14:21:15 -080033 allow_failures:
Brett Cannon21c2dd72017-06-03 10:24:17 -070034 - env: OPTIONAL=true
Brett Cannonbb09c862017-02-10 14:21:15 -080035 include:
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
Hiro Asaria5aa72a2017-05-31 18:34:00 -040043 - os: linux
Brett Cannonbb09c862017-02-10 14:21:15 -080044 language: python
Brett Cannon31b39012017-05-11 10:45:34 -070045 # 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 -070046 python: 3.6
Brett Cannon21c2dd72017-06-03 10:24:17 -070047 env: TESTING=docs
Brett Cannonbb09c862017-02-10 14:21:15 -080048 before_script:
Zachary Ware53251972017-02-15 16:18:03 -060049 - cd Doc
Mariattafca224f2017-05-16 13:48:25 -070050 # Sphinx is pinned so that new versions that introduce new warnings won't suddenly cause build failures.
51 # (Updating the version is fine as long as no warnings are raised by doing so.)
Jon Wayne Parrottbf63e8d2018-03-01 13:02:50 -080052 # The theme used by the docs is stored seperately, so we need to install that as well.
53 - python -m pip install sphinx~=1.6.1 blurb python-docs-theme
Brett Cannonbb09c862017-02-10 14:21:15 -080054 script:
Ned Deily122fc132017-11-27 17:07:32 -050055 - make check suspicious html SPHINXOPTS="-q -W -j4"
Antoine Pitroud7687eb2018-02-27 21:40:37 +010056 - os: osx
57 language: c
58 compiler: clang
59 # Testing under macOS is optional until testing stability has been demonstrated.
60 env: OPTIONAL=true
61 before_install:
62 # Python 3 is needed for Argument Clinic and multissl
INADA Naoki6b873992018-06-04 12:57:03 +090063 - HOMEBREW_NO_AUTO_UPDATE=1 brew install xz python3
Antoine Pitroud7687eb2018-02-27 21:40:37 +010064 - export PATH=$(brew --prefix)/bin:$(brew --prefix)/sbin:$PATH
Brett Cannonbb09c862017-02-10 14:21:15 -080065 - os: linux
66 language: c
Brett Cannonad2f9e22017-03-27 16:39:54 -070067 compiler: gcc
Brett Cannon21c2dd72017-06-03 10:24:17 -070068 env: OPTIONAL=true
Brett Cannonbb09c862017-02-10 14:21:15 -080069 before_script:
Zachary Ware7eb3f822018-02-18 10:19:37 -060070 - ./configure
71 - make -s -j4
72 # Need a venv that can parse covered code.
73 - ./python -m venv venv
74 - ./venv/bin/python -m pip install -U coverage
75 - ./venv/bin/python -m test.pythoninfo
Brett Cannonbb09c862017-02-10 14:21:15 -080076 script:
77 # Skip tests that re-run the entire test suite.
Thomas Moreaue8c368d2017-10-03 11:53:17 +020078 - ./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 Cannonbb09c862017-02-10 14:21:15 -080079 after_script: # Probably should be after_success once test suite updated to run under coverage.py.
80 # Make the `coverage` command available to Codecov w/ a version of Python that can parse all source files.
81 - source ./venv/bin/activate
82 - bash <(curl -s https://codecov.io/bash)
Brett Cannonbb09c862017-02-10 14:21:15 -080083
Zachary Ware7eb3f822018-02-18 10:19:37 -060084
85before_install:
86 - set -e
Berker Peksag157c0b82017-02-14 12:57:26 +030087 - |
Zachary Ware7eb3f822018-02-18 10:19:37 -060088 # Check short-circuit conditions
Antoine Pitroud7687eb2018-02-27 21:40:37 +010089 if [[ "${TESTING}" != "docs" ]]
Berker Peksag157c0b82017-02-14 12:57:26 +030090 then
Antoine Pitroud7687eb2018-02-27 21:40:37 +010091 if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]
Zachary Ware7eb3f822018-02-18 10:19:37 -060092 then
93 echo "Not a PR, doing full build."
94 else
95 # Pull requests are slightly complicated because $TRAVIS_COMMIT_RANGE
96 # may include more changes than desired if the history is convoluted.
97 # Instead, explicitly fetch the base branch and compare against the
98 # merge-base commit.
99 git fetch -q origin +refs/heads/$TRAVIS_BRANCH
100 changes=$(git diff --name-only HEAD $(git merge-base HEAD FETCH_HEAD))
101 echo "Files changed:"
102 echo "$changes"
103 if ! echo "$changes" | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
104 then
105 echo "Only docs were updated, stopping build process."
106 exit
107 fi
108 fi
Berker Peksag157c0b82017-02-14 12:57:26 +0300109 fi
Zachary Ware7eb3f822018-02-18 10:19:37 -0600110
111install:
112 - |
113 # Install OpenSSL as necessary
Antoine Pitroud7687eb2018-02-27 21:40:37 +0100114 if [[ "${TESTING}" != "docs" ]]
Zachary Ware7eb3f822018-02-18 10:19:37 -0600115 then
Christian Heimesced9cb52018-01-16 21:02:26 +0100116 # clang complains about unused-parameter a lot, redirect stderr
117 python3 Tools/ssl/multissltests.py --steps=library \
118 --base-directory ${HOME}/multissl \
119 --openssl ${OPENSSL} >/dev/null 2>&1
120 fi
Zachary Ware7eb3f822018-02-18 10:19:37 -0600121 - openssl version
122
123# Travis provides only 2 cores, so don't overdo the parallelism and waste memory.
124before_script:
125 - ./configure --with-pydebug
126 - make -j4 regen-all
127 - changes=`git status --porcelain`
128 - |
129 # Check for changes in regenerated files
Zachary Ware3f8f16d2017-06-10 23:04:36 -0500130 if ! test -z "$changes"
Zachary Ware0afbabe2017-06-10 21:37:40 -0500131 then
132 echo "Generated files not up to date"
Zachary Ware3f8f16d2017-06-10 23:04:36 -0500133 echo "$changes"
Zachary Ware0afbabe2017-06-10 21:37:40 -0500134 exit 1
135 fi
Zachary Ware7eb3f822018-02-18 10:19:37 -0600136 - make -j4
137 - make pythoninfo
Brett Cannonbb09c862017-02-10 14:21:15 -0800138
139script:
Brett Cannon70cb1872017-06-24 16:51:23 -0700140 # Using the built Python as patchcheck.py is built around the idea of using
141 # a checkout-build of CPython to know things like what base branch the changes
142 # should be compared against.
143 # Only run on Linux as the check only needs to be run once.
144 - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./python Tools/scripts/patchcheck.py --travis $TRAVIS_PULL_REQUEST; fi
Victor Stinner87d332d2017-10-24 01:29:53 -0700145 # Check that all symbols exported by libpython start with "Py" or "_Py"
146 - make smelly
Zachary Ware7eb3f822018-02-18 10:19:37 -0600147 # `-r -w` implicitly provided through `make buildbottest`.
148 - make buildbottest TESTOPTS="-j4 -uall,-cpu"
Brett Cannonbb09c862017-02-10 14:21:15 -0800149
150notifications:
151 email: false
Brett Cannon08765052018-04-04 19:12:39 -0700152 webhooks:
153 urls:
154 - https://python.zulipchat.com/api/v1/external/travis?api_key=QTP4LAknlFml0NuPQmAetvH4KQaokiQE&stream=core%2Ftest+runs
155 on_success: change
156 on_failure: always
Brett Cannonbb09c862017-02-10 14:21:15 -0800157 irc:
158 channels:
Donald Stufft4538ddc2017-02-10 19:58:34 -0500159 # This is set to a secure variable to prevent forks from notifying the
160 # IRC channel whenever they fail a build. This can be removed when travis
161 # implements https://github.com/travis-ci/travis-ci/issues/1094.
162 # The actual value here is: irc.freenode.net#python-dev
163 - 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 -0800164 on_success: change
165 on_failure: always
166 skip_join: true