Skip to content

Commit

Permalink
Fix travis. (#7237)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Sep 17, 2021
1 parent 31c1e13 commit 32e0858
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -28,7 +28,6 @@ addons:
update: false
apt:
packages:
- snapd
- unzip

before_install:
Expand Down
2 changes: 1 addition & 1 deletion tests/travis/run_test.sh
Expand Up @@ -92,6 +92,7 @@ fi

if [ ${TASK} == "s390x_test" ]; then
set -e
python3 -m pip install --user pytest hypothesis cmake

# Build and run C++ tests
rm -rf build
Expand All @@ -102,6 +103,5 @@ if [ ${TASK} == "s390x_test" ]; then

# Run model compatibility tests
cd ..
python3 -m pip install --user pytest hypothesis
PYTHONPATH=./python-package python3 -m pytest --fulltrace -v -rxXs tests/python/test_basic.py
fi
20 changes: 10 additions & 10 deletions tests/travis/setup.sh
@@ -1,11 +1,14 @@
#!/bin/bash

# https://travis-ci.community/t/macos-build-fails-because-of-homebrew-bundle-unknown-command/7296/27
# Use libomp 11.1.0: https://github.com/dmlc/xgboost/issues/7039
brew update # Force update, so that update doesn't overwrite our version of libomp.rb
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/679923b4eb48a8dc7ecc1f05d06063cd79b3fc00/Formula/libomp.rb -O $(find $(brew --repository) -name libomp.rb)
brew install cmake libomp
brew pin libomp
if [ ${TRAVIS_OS_NAME} == "osx" ]; then
# https://travis-ci.community/t/macos-build-fails-because-of-homebrew-bundle-unknown-command/7296/27
# Use libomp 11.1.0: https://github.com/dmlc/xgboost/issues/7039
brew update # Force update, so that update doesn't overwrite our version of libomp.rb
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/679923b4eb48a8dc7ecc1f05d06063cd79b3fc00/Formula/libomp.rb -O $(find $(brew --repository) -name libomp.rb)
brew install cmake libomp
brew pin libomp
fi



if [ ${TASK} == "python_test" ] || [ ${TASK} == "python_sdist_test" ]; then
Expand All @@ -29,10 +32,7 @@ if [ ${TASK} == "python_test" ] || [ ${TASK} == "python_sdist_test" ]; then
fi

if [ ${TASK} == "s390x_test" ] && [ ${TRAVIS_CPU_ARCH} == "s390x" ]; then
sudo snap install cmake --channel=3.17/beta --classic
export PATH=/snap/bin:${PATH}
cmake --version
sudo apt-get update
sudo apt-get install -y --no-install-recommends tar unzip wget git build-essential ninja-build \
time python3 python3-pip python3-numpy python3-scipy python3-sklearn r-base
time python3 python3-pip python3-numpy python3-scipy python3-sklearn r-base
fi

0 comments on commit 32e0858

Please sign in to comment.