forked from coala/coala-bears
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.travis.yml: Move unsupported check to a script
The unsupported check was previously a hack inside the main Travis CI `script` block, requiring many workarounds throughout the .travis.yml. Travis CI now supports custom `script` blocks for each build matrix entry, which allows the logic to be moved to an external and more clear script. In addition, all of the installation steps have been removed, making these jobs much faster to complete. Closes coala#2182
- Loading branch information
Showing
2 changed files
with
47 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Non-zero exit code is what we want to check | ||
set +e | ||
|
||
# Enable capturing the non-zero exit status of setup.py instead of tee | ||
set -o pipefail | ||
|
||
set -x | ||
|
||
# mypy-lang and guess-language-spirit do not install on unsupported versions | ||
sed -i.bak -E '/^(mypy-lang|guess-language-spirit)/d' bear-requirements.txt | ||
|
||
python setup.py install | tee setup.log | ||
|
||
retval=$? | ||
|
||
set +x | ||
|
||
# coalib.__init__.py should exit with 4 on unsupported versions of Python | ||
# And setup.py emits something else. | ||
if [[ $retval == 0 ]]; then | ||
echo "Unexpected error code 0" | ||
exit 1 | ||
else | ||
echo "setup.py error code $retval ok" | ||
fi | ||
|
||
# error when no lines selected by grep | ||
set -e | ||
|
||
grep -q 'coala supports only python 3.4 or later' setup.log | ||
|
||
echo "Unsupported check completed successfully" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters