Fix failing Travis CI on Mac (#4086)
* Fix failing Travis CI on Mac Use Homebrew Addon + latest Mac image * Use long command for pytest * Downgrade OSX image to xcode9.3, to use Java 8 * Install pytest in Python 2 environment * Remove clang-tidy from Travis
This commit is contained in:
parent
4fac9874e0
commit
a1c35cadf0
@ -6,9 +6,7 @@ os:
|
|||||||
- linux
|
- linux
|
||||||
- osx
|
- osx
|
||||||
|
|
||||||
osx_image: xcode8
|
osx_image: xcode9.3
|
||||||
|
|
||||||
group: deprecated-2017Q4
|
|
||||||
|
|
||||||
# Use Build Matrix to do lint and build seperately
|
# Use Build Matrix to do lint and build seperately
|
||||||
env:
|
env:
|
||||||
@ -68,6 +66,10 @@ addons:
|
|||||||
- g++-4.8
|
- g++-4.8
|
||||||
- gcc-7
|
- gcc-7
|
||||||
- g++-7
|
- g++-7
|
||||||
|
homebrew:
|
||||||
|
packages:
|
||||||
|
- graphviz
|
||||||
|
update: true
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- source dmlc-core/scripts/travis/travis_setup_env.sh
|
- source dmlc-core/scripts/travis/travis_setup_env.sh
|
||||||
|
|||||||
@ -11,22 +11,6 @@ if [ ${TASK} == "lint" ]; then
|
|||||||
(cat logclean.txt|grep warning) && exit -1
|
(cat logclean.txt|grep warning) && exit -1
|
||||||
(cat logclean.txt|grep error) && exit -1
|
(cat logclean.txt|grep error) && exit -1
|
||||||
|
|
||||||
# Rename cuda files for static analysis
|
|
||||||
for file in $(find src -name '*.cu'); do
|
|
||||||
cp "$file" "${file/.cu/_tmp.cc}"
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Running clang tidy..."
|
|
||||||
header_filter='(xgboost\/src|xgboost\/include)'
|
|
||||||
for filename in $(find src -name '*.cc'); do
|
|
||||||
clang-tidy $filename -header-filter=$header_filter -- -Iinclude -Idmlc-core/include -Irabit/include -std=c++11 >> logtidy.txt
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "---------clang-tidy failures----------"
|
|
||||||
# Fail only on warnings related to XGBoost source files
|
|
||||||
(cat logtidy.txt|grep -E 'xgboost.*warning'|grep -v dmlc-core) && exit -1
|
|
||||||
echo "----------------------------"
|
|
||||||
|
|
||||||
if grep -R '<regex>' src include tests/cpp plugin jvm-packages amalgamation; then
|
if grep -R '<regex>' src include tests/cpp plugin jvm-packages amalgamation; then
|
||||||
echo 'Do not use std::regex, since it is not supported by GCC 4.8.x'
|
echo 'Do not use std::regex, since it is not supported by GCC 4.8.x'
|
||||||
exit -1
|
exit -1
|
||||||
@ -62,15 +46,15 @@ if [ ${TASK} == "python_test" ]; then
|
|||||||
python -m pip install datatable --no-binary datatable
|
python -m pip install datatable --no-binary datatable
|
||||||
|
|
||||||
python -m pip install graphviz pytest pytest-cov codecov
|
python -m pip install graphviz pytest pytest-cov codecov
|
||||||
py.test -v --fulltrace -s tests/python --cov=python-package/xgboost || exit -1
|
python -m pytest -v --fulltrace -s tests/python --cov=python-package/xgboost || exit -1
|
||||||
codecov
|
codecov
|
||||||
|
|
||||||
source activate python2
|
source activate python2
|
||||||
echo "-------------------------------"
|
echo "-------------------------------"
|
||||||
python --version
|
python --version
|
||||||
conda install numpy scipy pandas matplotlib scikit-learn
|
conda install numpy scipy pandas matplotlib scikit-learn
|
||||||
python -m pip install graphviz
|
python -m pip install graphviz pytest
|
||||||
py.test -v --fulltrace -s tests/python || exit -1
|
python -m pytest -v --fulltrace -s tests/python || exit -1
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -82,7 +66,7 @@ if [ ${TASK} == "python_lightweight_test" ]; then
|
|||||||
python --version
|
python --version
|
||||||
conda install numpy scipy
|
conda install numpy scipy
|
||||||
python -m pip install graphviz pytest pytest-cov codecov
|
python -m pip install graphviz pytest pytest-cov codecov
|
||||||
py.test -v --fulltrace -s tests/python --cov=python-package/xgboost || exit -1
|
python -m pytest -v --fulltrace -s tests/python --cov=python-package/xgboost || exit -1
|
||||||
codecov
|
codecov
|
||||||
|
|
||||||
source activate python2
|
source activate python2
|
||||||
@ -91,7 +75,7 @@ if [ ${TASK} == "python_lightweight_test" ]; then
|
|||||||
conda install numpy scipy pytest
|
conda install numpy scipy pytest
|
||||||
python -m pip install graphviz
|
python -m pip install graphviz
|
||||||
python -m pip install flake8==3.4.1
|
python -m pip install flake8==3.4.1
|
||||||
py.test -v --fulltrace -s tests/python || exit -1
|
python -m pytest -v --fulltrace -s tests/python || exit -1
|
||||||
|
|
||||||
flake8 --ignore E501 python-package || exit -1
|
flake8 --ignore E501 python-package || exit -1
|
||||||
flake8 --ignore E501 tests/python || exit -1
|
flake8 --ignore E501 tests/python || exit -1
|
||||||
|
|||||||
@ -1,10 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ ${TRAVIS_OS_NAME} == "osx" ]; then
|
|
||||||
brew update
|
|
||||||
brew install graphviz
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ${TASK} == "lint" ]; then
|
if [ ${TASK} == "lint" ]; then
|
||||||
pip install --user cpplint 'pylint==1.4.4' 'astroid==1.3.6'
|
pip install --user cpplint 'pylint==1.4.4' 'astroid==1.3.6'
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user