@@ -5,13 +5,14 @@ group: beta
5
5
6
6
# To cache doc-building dependencies and C compiler output.
7
7
cache :
8
- - pip
9
- - ccache
8
+ - pip
9
+ - ccache
10
10
11
11
branches :
12
12
only :
13
13
- master
14
14
- /^\d\.\d$/
15
+ - buildbot-custom
15
16
16
17
matrix :
17
18
fast_finish : true
@@ -41,19 +42,12 @@ matrix:
41
42
compiler : gcc
42
43
env : OPTIONAL=true
43
44
before_script :
44
- - |
45
- if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
46
- then
47
- echo "Only docs were updated, stopping build process."
48
- exit
49
- fi
50
- # Build in release mode
51
- ./configure PYTHON_FOR_REGEN=python3
52
- make -s -j4
53
- # Need a venv that can parse covered code.
54
- ./python -m venv venv
55
- ./venv/bin/python -m pip install -U coverage
56
- ./venv/bin/python -m test.pythoninfo
45
+ - ./configure PYTHON_FOR_REGEN=python3
46
+ - make -s -j4
47
+ # Need a venv that can parse covered code.
48
+ - ./python -m venv venv
49
+ - ./venv/bin/python -m pip install -U coverage
50
+ - ./venv/bin/python -m test.pythoninfo
57
51
script :
58
52
# Skip tests that re-run the entire test suite.
59
53
- ./venv/bin/python -m coverage run --pylib -m test -uall,-cpu -x test_multiprocessing_fork -x test_multiprocessing_forkserver -x test_multiprocessing_spawn
@@ -62,48 +56,57 @@ matrix:
62
56
- source ./venv/bin/activate
63
57
- bash <(curl -s https://codecov.io/bash)
64
58
65
- # Travis provides only 2 cores, so don't overdo the parallelism and waste memory.
66
- before_script :
67
- - |
68
- set -e
69
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
70
- files_changed=$(git diff --name-only $TRAVIS_COMMIT_RANGE)
71
- else
72
- # Pull requests are slightly complicated because merging the PR commit without
73
- # rebasing causes it to retain its old commit date. Meaning in history if any
74
- # commits have been made on master that post-date it, they will be accidentally
75
- # included in the diff if we use the TRAVIS_COMMIT_RANGE variable.
76
- files_changed=$(git diff --name-only HEAD $(git merge-base HEAD $TRAVIS_BRANCH))
77
- fi
78
-
79
- # Prints changed files in this commit to help debug doc-only build issues.
80
- echo "Files changed: "
81
- echo $files_changed
82
59
83
- if ! echo "$files_changed" | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
60
+ before_install :
61
+ - set -e
62
+ - |
63
+ # Check short-circuit conditions
64
+ if [ "${TESTING}" != "docs" ]
84
65
then
85
- echo "Only docs were updated, stopping build process."
86
- exit
66
+ if [ "$TRAVIS_PULL_REQUEST" = "false" ]
67
+ then
68
+ echo "Not a PR, doing full build."
69
+ else
70
+ # Pull requests are slightly complicated because $TRAVIS_COMMIT_RANGE
71
+ # may include more changes than desired if the history is convoluted.
72
+ # Instead, explicitly fetch the base branch and compare against the
73
+ # merge-base commit.
74
+ git fetch -q origin +refs/heads/$TRAVIS_BRANCH
75
+ changes=$(git diff --name-only HEAD $(git merge-base HEAD FETCH_HEAD))
76
+ echo "Files changed:"
77
+ echo "$changes"
78
+ if ! echo "$changes" | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
79
+ then
80
+ echo "Only docs were updated, stopping build process."
81
+ exit
82
+ fi
83
+ fi
87
84
fi
88
- # Build in debug mode
89
- ./configure --with-pydebug PYTHON_FOR_REGEN=python3
90
- make -j4 regen-all
91
- changes=`git status --porcelain`
85
+
86
+ # Travis provides only 2 cores, so don't overdo the parallelism and waste memory.
87
+ before_script :
88
+ - ./configure --with-pydebug PYTHON_FOR_REGEN=python3
89
+ - make -j4 regen-all
90
+ - changes=`git status --porcelain`
91
+ - |
92
+ # Check for changes in regenerated files
92
93
if ! test -z "$changes"
93
94
then
94
95
echo "Generated files not up to date"
95
96
echo "$changes"
96
97
exit 1
97
98
fi
98
- make -j4
99
- make pythoninfo
99
+ - make -j4
100
+ - make pythoninfo
100
101
101
102
script :
102
103
# Using the built Python as patchcheck.py is built around the idea of using
103
104
# a checkout-build of CPython to know things like what base branch the changes
104
105
# should be compared against.
105
106
# Only run on Linux as the check only needs to be run once.
106
107
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./python Tools/scripts/patchcheck.py --travis $TRAVIS_PULL_REQUEST; fi
108
+ # Check that all symbols exported by libpython start with "Py" or "_Py"
109
+ - make smelly
107
110
# `-r -w` implicitly provided through `make buildbottest`.
108
111
- make buildbottest TESTOPTS="-j4 -uall,-cpu"
109
112
0 commit comments