blob: 7e1c2ef8756ed19a81fa745379d23bc295404660 [file] [log] [blame]
INADA Naoki98604c72017-02-20 09:44:53 +09001language: c
2dist: trusty
3sudo: false
4group: beta
5
Christian Heimes9721e512017-09-05 19:14:03 +02006# To cache doc-building dependencies and C compiler output.
7cache:
Zachary Ware21f53e72018-02-18 15:45:48 -06008 - pip
9 - ccache
INADA Naoki98604c72017-02-20 09:44:53 +090010
INADA Naoki730fb072018-04-25 10:28:06 +090011env:
12 global:
13 # Use -O3 because we don't use debugger on Travis-CI
14 - CFLAGS="-O3"
15
Brett Cannon32e220f2017-05-31 15:53:30 -070016branches:
17 only:
18 - master
19 - /^\d\.\d$/
Zachary Ware21f53e72018-02-18 15:45:48 -060020 - buildbot-custom
INADA Naoki98604c72017-02-20 09:44:53 +090021
22matrix:
Brett Cannon6a1b89d2017-06-03 10:38:43 -070023 fast_finish: true
24 allow_failures:
25 - env: OPTIONAL=true
INADA Naoki98604c72017-02-20 09:44:53 +090026 include:
27 - os: linux
Brett Cannon32e220f2017-05-31 15:53:30 -070028 language: c
29 compiler: clang
30 # gcc also works, but to keep the # of concurrent builds down, we use one C
Brett Cannon6a1b89d2017-06-03 10:38:43 -070031 # compiler here and the other to run the coverage build. Clang is preferred
32 # in this instance for its better error messages.
33 env: TESTING=cpython
Zachary Warec5bc6e42018-07-19 21:51:42 -050034 addons:
35 apt:
36 packages:
37 - xvfb
Brett Cannon32e220f2017-05-31 15:53:30 -070038 - os: linux
INADA Naoki98604c72017-02-20 09:44:53 +090039 language: python
40 python: 2.7
Brett Cannon6a1b89d2017-06-03 10:38:43 -070041 env: TESTING=docs
INADA Naoki98604c72017-02-20 09:44:53 +090042 before_script:
Zachary Warebd82a072017-05-13 10:05:53 -050043 - cd Doc
Brett Cannon97eb2a72017-05-16 14:41:00 -070044 # Sphinx is pinned so that new versions that introduce new warnings won't suddenly cause build failures.
45 # (Updating the version is fine as long as no warnings are raised by doing so.)
Brett Cannonfd583402017-05-22 17:47:01 -070046 - python -m pip install sphinx~=1.6.1
INADA Naoki98604c72017-02-20 09:44:53 +090047 script:
Mariatta497e5e12017-05-30 15:29:40 -070048 - make check suspicious html SPHINXOPTS="-q -W -j4"
INADA Naoki98604c72017-02-20 09:44:53 +090049
Zachary Ware21f53e72018-02-18 15:45:48 -060050
51before_install:
52 - set -e
53 - |
54 # Check short-circuit conditions
55 if [ "${TESTING}" != "docs" ]
56 then
57 if [ "$TRAVIS_PULL_REQUEST" = "false" ]
58 then
59 echo "Not a PR, doing full build."
60 else
61 # Pull requests are slightly complicated because $TRAVIS_COMMIT_RANGE
62 # may include more changes than desired if the history is convoluted.
63 # Instead, explicitly fetch the base branch and compare against the
64 # merge-base commit.
65 git fetch -q origin +refs/heads/$TRAVIS_BRANCH
66 changes=$(git diff --name-only HEAD $(git merge-base HEAD FETCH_HEAD))
67 echo "Files changed:"
68 echo "$changes"
69 if ! echo "$changes" | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
70 then
71 echo "Only docs were updated, stopping build process."
72 exit
73 fi
74 fi
75 fi
76
77
Zachary Wareddf8f142017-06-05 20:03:05 -050078# Travis provides only 2 cores, so don't overdo the parallelism and waste memory.
INADA Naoki98604c72017-02-20 09:44:53 +090079before_script:
Zachary Ware21f53e72018-02-18 15:45:48 -060080 - ./configure --with-pydebug
81 - make -j4 regen-all
82 - changes=`git status --porcelain`
INADA Naoki98604c72017-02-20 09:44:53 +090083 - |
Zachary Ware21f53e72018-02-18 15:45:48 -060084 # Check for changes in regenerated files
Zachary Ware51658f72017-06-11 17:45:40 -050085 if ! test -z "$changes"
86 then
87 echo "Generated files not up to date"
88 echo "$changes"
89 exit 1
90 fi
Zachary Ware21f53e72018-02-18 15:45:48 -060091 - make -j4
92 - make pythoninfo
INADA Naoki98604c72017-02-20 09:44:53 +090093
94script:
Zachary Ware21f53e72018-02-18 15:45:48 -060095 # Check that all symbols exported by libpython start with "Py" or "_Py"
96 - make smelly
INADA Naoki98604c72017-02-20 09:44:53 +090097 # `-r -w` implicitly provided through `make buildbottest`.
Zachary Warec5bc6e42018-07-19 21:51:42 -050098 - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then XVFB_RUN=xvfb-run; fi; $XVFB_RUN make buildbottest TESTOPTS="-j4 -uall,-cpu"
INADA Naoki98604c72017-02-20 09:44:53 +090099
100notifications:
101 email: false
102 irc:
103 channels:
104 # This is set to a secure variable to prevent forks from notifying the
105 # IRC channel whenever they fail a build. This can be removed when travis
106 # implements https://github.com/travis-ci/travis-ci/issues/1094.
107 # The actual value here is: irc.freenode.net#python-dev
108 - secure: "s7kAkpcom2yUJ8XqyjFI0obJmhAGrn1xmoivdaPdgBIA++X47TBp1x4pgDsbEsoalef7bEwa4l07KdT4qa+DOd/c4QxaWom7fbN3BuLVsZuVfODnl79+gYq/TAbGfyH+yDs18DXrUfPgwD7C5aW32ugsqAOd4iWzfGJQ5OrOZzqzGjYdYQUEkJFXgxDEIb4aHvxNDWGO3Po9uKISrhb5saQ0l776yLo1Ur7M4oxl8RTbCdgX0vf5TzPg52BgvZpOgt3DHOUYPeiJLKNjAE6ibg0U95sEvMfHX77nz4aFY4/3UI6FFaRla34rZ+mYKrn0TdxOhera1QOgPmM6HzdO4K44FpfK1DS0Xxk9U9/uApq+cG0bU3W+cVUHDBe5+90lpRBAXHeHCgT7TI8gec614aiT8lEr3+yH8OBRYGzkjNK8E2LJZ/SxnVxDe7aLF6AWcoWLfS6/ziAIBFQ5Nc4U72CT8fGVSkl8ywPiRlvixKdvTODMSZo0jMqlfZSNaAPTsNRx4wu5Uis4qekwe32Fz4aB6KGpsuuVjBi+H6v0RKxNJNGY3JKDiEH2TK0UE2auJ5GvLW48aUVFcQMB7euCWYXlSWVRHh3WLU8QXF29Dw4JduRZqUpOdRgMHU79UHRq+mkE0jAS/nBcS6CvsmxCpTSrfVYuMOu32yt18QQoTyU="
109 on_success: change
110 on_failure: always
111 skip_join: true