Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 21f53e7

Browse files
authored
[2.7] Clean up Travis config (pythonGH-5727)
(cherry picked from commit 7eb3f82)
1 parent fd9d1c9 commit 21f53e7

File tree

1 file changed

+39
-13
lines changed

1 file changed

+39
-13
lines changed

.travis.yml

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ group: beta
55

66
# To cache doc-building dependencies and C compiler output.
77
cache:
8-
- pip
9-
- ccache
8+
- pip
9+
- ccache
1010

1111
branches:
1212
only:
1313
- master
1414
- /^\d\.\d$/
15+
- buildbot-custom
1516

1617
matrix:
1718
fast_finish: true
@@ -37,28 +38,53 @@ matrix:
3738
script:
3839
- make check suspicious html SPHINXOPTS="-q -W -j4"
3940

40-
# Travis provides only 2 cores, so don't overdo the parallelism and waste memory.
41-
before_script:
41+
42+
before_install:
43+
- set -e
4244
- |
43-
set -e
44-
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.rst$)|(^Doc)'
45+
# Check short-circuit conditions
46+
if [ "${TESTING}" != "docs" ]
4547
then
46-
echo "Only docs were updated, stopping build process."
47-
exit
48+
if [ "$TRAVIS_PULL_REQUEST" = "false" ]
49+
then
50+
echo "Not a PR, doing full build."
51+
else
52+
# Pull requests are slightly complicated because $TRAVIS_COMMIT_RANGE
53+
# may include more changes than desired if the history is convoluted.
54+
# Instead, explicitly fetch the base branch and compare against the
55+
# merge-base commit.
56+
git fetch -q origin +refs/heads/$TRAVIS_BRANCH
57+
changes=$(git diff --name-only HEAD $(git merge-base HEAD FETCH_HEAD))
58+
echo "Files changed:"
59+
echo "$changes"
60+
if ! echo "$changes" | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
61+
then
62+
echo "Only docs were updated, stopping build process."
63+
exit
64+
fi
65+
fi
4866
fi
49-
./configure --with-pydebug
50-
make -j4
51-
make -j4 regen-all
52-
changes=`git status --porcelain`
67+
68+
69+
# Travis provides only 2 cores, so don't overdo the parallelism and waste memory.
70+
before_script:
71+
- ./configure --with-pydebug
72+
- make -j4 regen-all
73+
- changes=`git status --porcelain`
74+
- |
75+
# Check for changes in regenerated files
5376
if ! test -z "$changes"
5477
then
5578
echo "Generated files not up to date"
5679
echo "$changes"
5780
exit 1
5881
fi
59-
make pythoninfo
82+
- make -j4
83+
- make pythoninfo
6084

6185
script:
86+
# Check that all symbols exported by libpython start with "Py" or "_Py"
87+
- make smelly
6288
# `-r -w` implicitly provided through `make buildbottest`.
6389
- make buildbottest TESTOPTS="-j4 -uall,-cpu"
6490

0 commit comments

Comments
 (0)