blob: d7387e5f9831b2d79a9add3e6f505a681d7381c7 [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:
8 - pip
9 - ccache
Christian Heimesced9cb52018-01-16 21:02:26 +010010 - directories:
11 - $HOME/multissl
12
13env:
14 global:
15 - OPENSSL=1.1.0g
16 - OPENSSL_DIR="$HOME/multissl/openssl/${OPENSSL}"
17 - PATH="${OPENSSL_DIR}/bin:$PATH"
18 - CFLAGS="-I${OPENSSL_DIR}/include"
19 - LDFLAGS="-L${OPENSSL_DIR}/lib"
20 # Set rpath with env var instead of -Wl,-rpath linker flag
21 # OpenSSL ignores LDFLAGS when linking bin/openssl
22 - LD_RUN_PATH="${OPENSSL_DIR}/lib"
Brett Cannonbb09c862017-02-10 14:21:15 -080023
Donald Stufft984eef72017-02-14 20:21:32 -050024branches:
25 only:
26 - master
27 - /^\d\.\d$/
28
Brett Cannonbb09c862017-02-10 14:21:15 -080029matrix:
Brett Cannonb52260d2017-02-14 16:37:15 -080030 fast_finish: true
Brett Cannonbb09c862017-02-10 14:21:15 -080031 allow_failures:
Brett Cannon21c2dd72017-06-03 10:24:17 -070032 - env: OPTIONAL=true
Brett Cannonbb09c862017-02-10 14:21:15 -080033 include:
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
Hiro Asaria5aa72a2017-05-31 18:34:00 -040041 - os: linux
Brett Cannonbb09c862017-02-10 14:21:15 -080042 language: python
Brett Cannon31b39012017-05-11 10:45:34 -070043 # 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 -070044 python: 3.6
Brett Cannon21c2dd72017-06-03 10:24:17 -070045 env: TESTING=docs
Brett Cannonbb09c862017-02-10 14:21:15 -080046 before_script:
Zachary Ware53251972017-02-15 16:18:03 -060047 - cd Doc
Mariattafca224f2017-05-16 13:48:25 -070048 # Sphinx is pinned so that new versions that introduce new warnings won't suddenly cause build failures.
49 # (Updating the version is fine as long as no warnings are raised by doing so.)
Ned Deilyfcd97d42017-09-05 00:10:31 -070050 - python -m pip install sphinx~=1.6.1 blurb
Brett Cannonbb09c862017-02-10 14:21:15 -080051 script:
Ned Deily122fc132017-11-27 17:07:32 -050052 - make check suspicious html SPHINXOPTS="-q -W -j4"
Brett Cannonbb09c862017-02-10 14:21:15 -080053 - os: linux
54 language: c
Brett Cannonad2f9e22017-03-27 16:39:54 -070055 compiler: gcc
Brett Cannon21c2dd72017-06-03 10:24:17 -070056 env: OPTIONAL=true
Brett Cannonbb09c862017-02-10 14:21:15 -080057 before_script:
Berker Peksag157c0b82017-02-14 12:57:26 +030058 - |
Zachary Warec53b13b2017-06-05 18:42:17 -050059 if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
Berker Peksag157c0b82017-02-14 12:57:26 +030060 then
61 echo "Only docs were updated, stopping build process."
62 exit
63 fi
Christian Heimesced9cb52018-01-16 21:02:26 +010064 python3 Tools/ssl/multissltests.py --steps=library \
65 --base-directory ${HOME}/multissl \
66 --openssl ${OPENSSL} >/dev/null
67 openssl version
Berker Peksag157c0b82017-02-14 12:57:26 +030068 ./configure
69 make -s -j4
70 # Need a venv that can parse covered code.
71 ./python -m venv venv
72 ./venv/bin/python -m pip install -U coverage
Victor Stinnerb907abc2017-08-17 16:40:51 +020073 ./venv/bin/python -m test.pythoninfo
Brett Cannonbb09c862017-02-10 14:21:15 -080074 script:
75 # Skip tests that re-run the entire test suite.
Thomas Moreaue8c368d2017-10-03 11:53:17 +020076 - ./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 -080077 after_script: # Probably should be after_success once test suite updated to run under coverage.py.
78 # Make the `coverage` command available to Codecov w/ a version of Python that can parse all source files.
79 - source ./venv/bin/activate
80 - bash <(curl -s https://codecov.io/bash)
Brett Cannonbb09c862017-02-10 14:21:15 -080081
Zachary Warec53b13b2017-06-05 18:42:17 -050082# Travis provides only 2 cores, so don't overdo the parallelism and waste memory.
Brett Cannonbb09c862017-02-10 14:21:15 -080083before_script:
Berker Peksag157c0b82017-02-14 12:57:26 +030084 - |
Zachary Ware0afbabe2017-06-10 21:37:40 -050085 set -e
Ammar Askarb2ec3612018-01-27 15:53:56 -050086 if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
87 files_changed=$(git diff --name-only $TRAVIS_COMMIT_RANGE)
88 else
89 # Pull requests are slightly complicated because merging the PR commit without
90 # rebasing causes it to retain its old commit date. Meaning in history if any
91 # commits have been made on master that post-date it, they will be accidentally
92 # included in the diff if we use the TRAVIS_COMMIT_RANGE variable.
93 files_changed=$(git diff --name-only HEAD $(git merge-base HEAD $TRAVIS_BRANCH))
94 fi
95
96 # Prints changed files in this commit to help debug doc-only build issues.
97 echo "Files changed: "
98 echo $files_changed
99
100 if ! echo $files_changed | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
Berker Peksag157c0b82017-02-14 12:57:26 +0300101 then
102 echo "Only docs were updated, stopping build process."
103 exit
104 fi
Christian Heimesced9cb52018-01-16 21:02:26 +0100105 if [ "${TESTING}" != "docs" ]; then
106 # clang complains about unused-parameter a lot, redirect stderr
107 python3 Tools/ssl/multissltests.py --steps=library \
108 --base-directory ${HOME}/multissl \
109 --openssl ${OPENSSL} >/dev/null 2>&1
110 fi
111 openssl version
Berker Peksag157c0b82017-02-14 12:57:26 +0300112 ./configure --with-pydebug
113 make -j4
Zachary Ware0afbabe2017-06-10 21:37:40 -0500114 make -j4 regen-all clinic
Zachary Ware3f8f16d2017-06-10 23:04:36 -0500115 changes=`git status --porcelain`
116 if ! test -z "$changes"
Zachary Ware0afbabe2017-06-10 21:37:40 -0500117 then
118 echo "Generated files not up to date"
Zachary Ware3f8f16d2017-06-10 23:04:36 -0500119 echo "$changes"
Zachary Ware0afbabe2017-06-10 21:37:40 -0500120 exit 1
121 fi
Victor Stinner92b1f902017-08-18 17:30:51 +0200122 make pythoninfo
Brett Cannonbb09c862017-02-10 14:21:15 -0800123
124script:
Brett Cannon70cb1872017-06-24 16:51:23 -0700125 # Using the built Python as patchcheck.py is built around the idea of using
126 # a checkout-build of CPython to know things like what base branch the changes
127 # should be compared against.
128 # Only run on Linux as the check only needs to be run once.
129 - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./python Tools/scripts/patchcheck.py --travis $TRAVIS_PULL_REQUEST; fi
Brett Cannonbb09c862017-02-10 14:21:15 -0800130 # `-r -w` implicitly provided through `make buildbottest`.
Victor Stinner5b392bb2017-07-20 15:46:32 +0200131 - make buildbottest TESTOPTS="-j4 -uall,-cpu"
Victor Stinner87d332d2017-10-24 01:29:53 -0700132 # Check that all symbols exported by libpython start with "Py" or "_Py"
133 - make smelly
Brett Cannonbb09c862017-02-10 14:21:15 -0800134
135notifications:
136 email: false
137 irc:
138 channels:
Donald Stufft4538ddc2017-02-10 19:58:34 -0500139 # This is set to a secure variable to prevent forks from notifying the
140 # IRC channel whenever they fail a build. This can be removed when travis
141 # implements https://github.com/travis-ci/travis-ci/issues/1094.
142 # The actual value here is: irc.freenode.net#python-dev
143 - 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 -0800144 on_success: change
145 on_failure: always
146 skip_join: true