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

Skip to content

Commit 7eb3f82

Browse files
authored
Clean up Travis config (GH-5727)
1 parent 03e3c34 commit 7eb3f82

1 file changed

Lines changed: 52 additions & 48 deletions

File tree

.travis.yml

Lines changed: 52 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ group: beta
55

66
# To cache doc-building dependencies and C compiler output.
77
cache:
8-
- pip
9-
- ccache
10-
- directories:
11-
- $HOME/multissl
8+
- pip
9+
- ccache
10+
- directories:
11+
- $HOME/multissl
1212

1313
env:
1414
global:
@@ -26,6 +26,7 @@ branches:
2626
only:
2727
- master
2828
- /^\d\.\d$/
29+
- buildbot-custom
2930

3031
matrix:
3132
fast_finish: true
@@ -56,22 +57,12 @@ matrix:
5657
compiler: gcc
5758
env: OPTIONAL=true
5859
before_script:
59-
- |
60-
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
61-
then
62-
echo "Only docs were updated, stopping build process."
63-
exit
64-
fi
65-
python3 Tools/ssl/multissltests.py --steps=library \
66-
--base-directory ${HOME}/multissl \
67-
--openssl ${OPENSSL} >/dev/null
68-
openssl version
69-
./configure
70-
make -s -j4
71-
# Need a venv that can parse covered code.
72-
./python -m venv venv
73-
./venv/bin/python -m pip install -U coverage
74-
./venv/bin/python -m test.pythoninfo
60+
- ./configure
61+
- make -s -j4
62+
# Need a venv that can parse covered code.
63+
- ./python -m venv venv
64+
- ./venv/bin/python -m pip install -U coverage
65+
- ./venv/bin/python -m test.pythoninfo
7566
script:
7667
# Skip tests that re-run the entire test suite.
7768
- ./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
@@ -80,58 +71,71 @@ matrix:
8071
- source ./venv/bin/activate
8172
- bash <(curl -s https://codecov.io/bash)
8273

83-
# Travis provides only 2 cores, so don't overdo the parallelism and waste memory.
84-
before_script:
74+
75+
before_install:
76+
- set -e
8577
- |
86-
set -e
87-
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
88-
files_changed=$(git diff --name-only $TRAVIS_COMMIT_RANGE)
89-
else
90-
# Pull requests are slightly complicated because merging the PR commit without
91-
# rebasing causes it to retain its old commit date. Meaning in history if any
92-
# commits have been made on master that post-date it, they will be accidentally
93-
# included in the diff if we use the TRAVIS_COMMIT_RANGE variable.
94-
files_changed=$(git diff --name-only HEAD $(git merge-base HEAD $TRAVIS_BRANCH))
78+
# Check short-circuit conditions
79+
if [ "${TESTING}" != "docs" ]
80+
then
81+
if [ "$TRAVIS_PULL_REQUEST" = "false" ]
82+
then
83+
echo "Not a PR, doing full build."
84+
else
85+
# Pull requests are slightly complicated because $TRAVIS_COMMIT_RANGE
86+
# may include more changes than desired if the history is convoluted.
87+
# Instead, explicitly fetch the base branch and compare against the
88+
# merge-base commit.
89+
git fetch -q origin +refs/heads/$TRAVIS_BRANCH
90+
changes=$(git diff --name-only HEAD $(git merge-base HEAD FETCH_HEAD))
91+
echo "Files changed:"
92+
echo "$changes"
93+
if ! echo "$changes" | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
94+
then
95+
echo "Only docs were updated, stopping build process."
96+
exit
97+
fi
98+
fi
9599
fi
96100
97-
# Prints changed files in this commit to help debug doc-only build issues.
98-
echo "Files changed: "
99-
echo $files_changed
100-
101-
if ! echo "$files_changed" | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
101+
install:
102+
- |
103+
# Install OpenSSL as necessary
104+
if [ "${TESTING}" != "docs" ]
102105
then
103-
echo "Only docs were updated, stopping build process."
104-
exit
105-
fi
106-
if [ "${TESTING}" != "docs" ]; then
107106
# clang complains about unused-parameter a lot, redirect stderr
108107
python3 Tools/ssl/multissltests.py --steps=library \
109108
--base-directory ${HOME}/multissl \
110109
--openssl ${OPENSSL} >/dev/null 2>&1
111110
fi
112-
openssl version
113-
./configure --with-pydebug
114-
make -j4 regen-all
115-
changes=`git status --porcelain`
111+
- openssl version
112+
113+
# Travis provides only 2 cores, so don't overdo the parallelism and waste memory.
114+
before_script:
115+
- ./configure --with-pydebug
116+
- make -j4 regen-all
117+
- changes=`git status --porcelain`
118+
- |
119+
# Check for changes in regenerated files
116120
if ! test -z "$changes"
117121
then
118122
echo "Generated files not up to date"
119123
echo "$changes"
120124
exit 1
121125
fi
122-
make -j4
123-
make pythoninfo
126+
- make -j4
127+
- make pythoninfo
124128

125129
script:
126130
# Using the built Python as patchcheck.py is built around the idea of using
127131
# a checkout-build of CPython to know things like what base branch the changes
128132
# should be compared against.
129133
# Only run on Linux as the check only needs to be run once.
130134
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./python Tools/scripts/patchcheck.py --travis $TRAVIS_PULL_REQUEST; fi
131-
# `-r -w` implicitly provided through `make buildbottest`.
132-
- make buildbottest TESTOPTS="-j4 -uall,-cpu"
133135
# Check that all symbols exported by libpython start with "Py" or "_Py"
134136
- make smelly
137+
# `-r -w` implicitly provided through `make buildbottest`.
138+
- make buildbottest TESTOPTS="-j4 -uall,-cpu"
135139

136140
notifications:
137141
email: false

0 commit comments

Comments
 (0)