2015-07-05 00:52:36 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -o pipefail
|
|
|
|
|
2017-03-31 07:39:18 -07:00
|
|
|
if [[ "${CI_TARGET}" == lint ]]; then
|
2015-07-05 00:52:36 -07:00
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2019-06-18 11:13:47 -07:00
|
|
|
echo 'Python info:'
|
2017-09-09 07:44:38 -07:00
|
|
|
(
|
2019-06-18 11:13:47 -07:00
|
|
|
set -x
|
|
|
|
python3 --version
|
|
|
|
python2 --version
|
|
|
|
python --version
|
|
|
|
pip3 --version
|
|
|
|
pip2 --version
|
|
|
|
pip --version
|
2019-07-28 02:48:54 -07:00
|
|
|
|
|
|
|
pyenv --version
|
2019-06-18 11:13:47 -07:00
|
|
|
pyenv versions
|
|
|
|
) 2>&1 | sed 's/^/ /' || true
|
|
|
|
|
|
|
|
# Use pyenv, but not for OSX on Travis, where it only has the "system" version.
|
|
|
|
if [[ "${TRAVIS_OS_NAME}" != osx ]] && command -v pyenv; then
|
|
|
|
echo 'Setting Python versions via pyenv'
|
2019-07-28 02:48:54 -07:00
|
|
|
|
|
|
|
# Prefer Python 2 over 3 (more conservative).
|
2019-06-18 11:13:47 -07:00
|
|
|
pyenv global 2.7.15:3.7
|
|
|
|
|
|
|
|
echo 'Updated Python info:'
|
|
|
|
(
|
|
|
|
set -x
|
|
|
|
python3 --version
|
|
|
|
python2 --version
|
|
|
|
python --version
|
|
|
|
|
2019-06-19 11:28:37 -07:00
|
|
|
python3 -m pip --version
|
|
|
|
python2 -m pip --version
|
2019-06-18 11:13:47 -07:00
|
|
|
) 2>&1 | sed 's/^/ /'
|
2015-09-22 05:36:15 -07:00
|
|
|
fi
|
2017-11-28 23:50:11 -07:00
|
|
|
|
2018-01-07 16:37:31 -07:00
|
|
|
echo "Install node (LTS)"
|
2017-11-28 23:50:11 -07:00
|
|
|
|
2018-01-07 16:37:31 -07:00
|
|
|
if [[ "${TRAVIS_OS_NAME}" == osx ]] || [ ! -f ~/.nvm/nvm.sh ]; then
|
|
|
|
curl -o ~/.nvm/nvm.sh https://raw.githubusercontent.com/creationix/nvm/master/nvm.sh
|
2017-11-28 23:50:11 -07:00
|
|
|
fi
|
2018-01-07 16:37:31 -07:00
|
|
|
|
|
|
|
source ~/.nvm/nvm.sh
|
|
|
|
nvm install --lts
|
|
|
|
nvm use --lts
|
2019-07-08 03:53:43 -07:00
|
|
|
|
|
|
|
if [[ -n "$CMAKE_URL" ]]; then
|
|
|
|
echo "Installing custom CMake: $CMAKE_URL"
|
2019-09-29 15:10:29 -07:00
|
|
|
curl --retry 5 --silent --show-error --fail -o /tmp/cmake-installer.sh "$CMAKE_URL"
|
2019-07-08 03:53:43 -07:00
|
|
|
mkdir -p "$HOME/.local/bin" /opt/cmake-custom
|
|
|
|
bash /tmp/cmake-installer.sh --prefix=/opt/cmake-custom --skip-license
|
|
|
|
ln -sfn /opt/cmake-custom/bin/cmake "$HOME/.local/bin/cmake"
|
|
|
|
cmake_version="$(cmake --version)"
|
|
|
|
echo "$cmake_version" | grep -qF '2.8.12' || {
|
|
|
|
echo "Unexpected CMake version: $cmake_version"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
fi
|