-
-
Notifications
You must be signed in to change notification settings - Fork 423
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include setup helper scripts in tardis
We can't use an external repository because we are hacking the scripts heavily to work with a conda environment file instead of defining the dependencies with environment variables in .travis.yml.
- Loading branch information
Showing
5 changed files
with
116 additions
and
5 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
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
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,62 @@ | ||
#!/bin/bash | ||
|
||
# Note to the future: keep the conda scripts separate for each OS because many | ||
# packages call ci-helpers with: | ||
# | ||
# source ci-helpers/travis/setup_conda_$TRAVIS_OS_NAME.sh | ||
# | ||
# The present script was added later. | ||
|
||
if [[ $DEBUG == True ]]; then | ||
set -x | ||
fi | ||
|
||
# First check: if the build should be run at all based on the event type | ||
|
||
if [[ ! -z $EVENT_TYPE ]]; then | ||
for event in $EVENT_TYPE; do | ||
if [[ $TRAVIS_EVENT_TYPE = $event ]]; then | ||
allow_to_build=True | ||
fi | ||
done | ||
if [[ $allow_to_build != True ]]; then | ||
travis_terminate 0 | ||
fi | ||
fi | ||
|
||
# Second check: if any of the custom tags are used to skip the build | ||
|
||
TR_SKIP="\[(skip travis|travis skip)\]" | ||
DOCS_ONLY="\[docs only|build docs\]" | ||
|
||
# Travis doesn't provide the commit message of the top of the branch for | ||
# PRs, only the commit message of the merge. Thus this ugly workaround is | ||
# needed for now. | ||
|
||
if [[ $TRAVIS_PULL_REQUEST == false ]]; then | ||
COMMIT_MESSAGE=${TRAVIS_COMMIT_MESSAGE} | ||
else | ||
COMMIT_MESSAGE=$(git show -s $TRAVIS_COMMIT_RANGE | awk 'BEGIN{count=0}{if ($1=="Author:") count++; if (count==1) print $0}') | ||
fi | ||
|
||
# Skip build if the commit message contains [skip travis] or [travis skip] | ||
# Remove workaround once travis has this feature natively | ||
# https://github.com/travis-ci/travis-ci/issues/5032 | ||
|
||
if [[ ! -z $(echo ${COMMIT_MESSAGE} | grep -E "${TR_SKIP}") ]]; then | ||
echo "Travis was requested to be skipped by the commit message, exiting." | ||
travis_terminate 0 | ||
elif [[ ! -z $(echo ${COMMIT_MESSAGE} | grep -E "${DOCS_ONLY}") ]]; then | ||
if [[ $SETUP_CMD != *build_docs* ]] && [[ $SETUP_CMD != *build_sphinx* ]]; then | ||
echo "Only docs build was requested by the commit message, exiting." | ||
travis_terminate 0 | ||
fi | ||
fi | ||
|
||
echo "==================== Starting executing ci-helpers scripts =====================" | ||
|
||
source travis/setup_conda_$TRAVIS_OS_NAME.sh; | ||
|
||
echo "================= Returning executing local .travis.yml script =================" | ||
|
||
set +x |
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,23 @@ | ||
#!/bin/bash | ||
|
||
# Install conda | ||
# http://conda.pydata.org/docs/travis.html#the-travis-yml-file | ||
echo ls -la $HOME/miniconda | ||
ls -la $HOME/miniconda | ||
if [ ! "$(ls -A $HOME/miniconda)" ]; then | ||
echo "Cache is empty, installing miniconda and test environment." | ||
# Control will enter here if $HOME/miniconda is empty. | ||
rm -r $HOME/miniconda | ||
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh | ||
bash miniconda.sh -b -p $HOME/miniconda | ||
|
||
export PATH="$HOME/miniconda/bin:$PATH" | ||
|
||
hash -r | ||
|
||
conda env create -f tardis_env27.yml | ||
else | ||
export PATH="$HOME/miniconda/bin:$PATH" | ||
fi | ||
|
||
source activate tardis |
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,30 @@ | ||
#!/bin/bash | ||
|
||
# Workaround for https://github.com/travis-ci/travis-ci/issues/6307, which | ||
# caused the following error on MacOS X workers: | ||
# | ||
# /Users/travis/build.sh: line 109: shell_session_update: command not found | ||
# | ||
rvm get head | ||
|
||
# Install conda | ||
# http://conda.pydata.org/docs/travis.html#the-travis-yml-file | ||
echo ls -la $HOME/miniconda | ||
ls -la $HOME/miniconda | ||
if [ ! "$(ls -A $HOME/miniconda)" ]; then | ||
echo "Cache is empty, installing miniconda and test environment." | ||
# Control will enter here if $HOME/miniconda is empty. | ||
rm -r $HOME/miniconda | ||
# Control will enter here if $HOME/miniconda doesn't exist. | ||
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh | ||
|
||
export PATH="$HOME/miniconda/bin:$PATH" | ||
|
||
hash -r | ||
|
||
conda env create -f tardis_env27.yml | ||
else | ||
export PATH="$HOME/miniconda/bin:$PATH" | ||
fi | ||
|
||
source activate tardis |