Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Travis Caching and separate scripts for CI #866

Merged
merged 18 commits into from
Aug 30, 2018
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 25 additions & 31 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ python:
virtualenv:
system_site_packages: true

cache:
apt: true
addons:
apt:
packages:
- clang
- gdb

sudo: true

Expand All @@ -20,78 +23,69 @@ env:
- ASTROPY_USE_SYSTEM_PYTEST=1
- SETUP_CMD='test'
- TEST_MODE='normal'
- TARDIS_REF_DATA_URL='https://github.com/tardis-sn/tardis-refdata.git'
- REF_DATA_HOME=$HOME/tardis-refdata
unoebauer marked this conversation as resolved.
Show resolved Hide resolved
- MINICONDA_URL='http://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh'
- SAVE_COVERAGE=false
- GIT_LFS_SKIP_SMUDGE=1

matrix:
include:
- python: 2.7
env:
- COMPILER=gcc
- SETUP_CMD='test --coverage --args="--tardis-refdata=$HOME/tardis-refdata/"'
- SETUP_CMD='test --coverage --args="--tardis-refdata=$REF_DATA_HOME"'
- TEST_MODE='spectrum'
- SAVE_COVERAGE=true

- python: 2.7
env:
- COMPILER=clang
- SETUP_CMD='test --args="--tardis-refdata=$HOME/tardis-refdata/"'
- SETUP_CMD='test --args="--tardis-refdata=$REF_DATA_HOME"'
- TEST_MODE='spectrum'

#trouble with osx building due to segfault at cython (https://github.com/cython/cython/issues/2199)
- os: osx
language: generic
env:
- COMPILER=clang
- SETUP_CMD='test --args="--tardis-refdata=$HOME/tardis-refdata/"'
- SETUP_CMD='test --args="--tardis-refdata=$REF_DATA_HOME"'
- TEST_MODE='spectrum'
- MINICONDA_URL='http://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh'


- python: 2.7
env: SETUP_CMD='test'

addons:
apt:
packages:
- clang
- gdb


cache:
apt: true
directories:
- $HOME/miniconda
#- $REF_DATA_HOME


before_install:
# We do this to make sure we get the dependencies so pip works below
- export PYTHONIOENCODING=UTF8
- wget $MINICONDA_URL -O miniconda.sh
- chmod +x miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH=$HOME/miniconda/bin:$PATH
- hash -r
- conda update --yes conda
- source ci-helpers/install_miniconda.sh
- if [[ $TEST_MODE == 'spectrum' ]]; then conda install -c conda-forge git-lfs=2.2.1 -y; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git lfs install --skip-smudge; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git clone $TARDIS_REF_DATA_URL $HOME/tardis-refdata; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then cd $HOME/tardis-refdata; fi
# Use the following to get the ref-data from the master;
- if [[ $TEST_MODE == 'spectrum' ]]; then git clone https://github.com/tardis-sn/tardis-refdata.git $REF_DATA_HOME; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then cd $REF_DATA_HOME; fi
# Use the following to get the ref-data from the master;
- if [[ $TEST_MODE == 'spectrum' ]]; then git fetch origin; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git checkout origin/master; fi
# Use the following to get the ref-data from a specific pull request;
# - if [[ $TEST_MODE == 'spectrum' ]]; then git fetch origin pull/11/head:thomson-ref; fi
# - if [[ $TEST_MODE == 'spectrum' ]]; then git checkout thomson-ref; fi
# Use the following to get the ref-data from a specific pull request;
# - if [[ $TEST_MODE == 'spectrum' ]]; then git fetch origin pull/11/head:thomson-ref; fi
# - if [[ $TEST_MODE == 'spectrum' ]]; then git checkout thomson-ref; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git lfs pull --include="atom_data/kurucz_cd23_chianti_H_He.h5" origin; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git lfs pull --include="atom_data/chianti_He.h5" origin; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git lfs pull --include="plasma_reference/" origin; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git lfs pull --include="unit_test_data.h5" origin; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then cd $TRAVIS_BUILD_DIR; fi

#- source ci-helpers/fetch_reference_data.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment here for later



install:
- cd $TRAVIS_BUILD_DIR
- conda env create -f tardis_env27.yml
- source activate tardis
- conda install -y -c conda-forge codecov
- source ci-helpers/install_tardis_env.sh
#trouble with building due to segfault at cython (https://github.com/cython/cython/issues/2199)
#remove if we can get normal cython through conda
- git clone https://github.com/cython/cython
Expand Down
16 changes: 16 additions & 0 deletions ci-helpers/fetch_reference_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
git lfs install
if test -e $REF_DATA_HOME; then
echo "Ref data available"
else
git clone https://github.com/tardis-sn/tardis-refdata.git $REF_DATA_HOME
cd $REF_DATA_HOME
# Use the following to get the ref-data from the master;
git fetch origin
git checkout origin/master
# Use the following to get the ref-data from a specific pull request
#git fetch origin pull/11/head:thomson-ref
git lfs pull --include="atom_data/kurucz_cd23_chianti_H_He.h5" origin/master
git lfs pull --include="atom_data/chianti_He.h5" origin/master
git lfs pull --include="plasma_reference/" origin/master
git lfs pull --include="unit_test_data.h5" origin/master
cd $TRAVIS_BUILD_DIR
17 changes: 17 additions & 0 deletions ci-helpers/install_miniconda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export PYTHONIOENCODING=UTF8
if test -e $HOME/miniconda/bin; then
echo "miniconda already installed.";
export PATH=$HOME/miniconda/bin:$PATH
hash -r
#conda update --yes conda

else
wget $MINICONDA_URL -O miniconda.sh
chmod +x miniconda.sh
rm -r $HOME/miniconda
bash miniconda.sh -b -p $HOME/miniconda

export PATH=$HOME/miniconda/bin:$PATH
hash -r
conda update --yes conda
fi
8 changes: 8 additions & 0 deletions ci-helpers/install_tardis_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cd $TRAVIS_BUILD_DIR
if test -e $HOME/miniconda/envs/tardis; then
unoebauer marked this conversation as resolved.
Show resolved Hide resolved
echo "TARDIS env already installed.";
else
conda env create -f tardis_env27.yml
fi

source activate tardis
5 changes: 3 additions & 2 deletions tardis_env27.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ dependencies:
- requests=2.9.1
- docopt=0.6.2
- pytest-cov=2.2.1

- codecov
#testing requirements
- git-lfs=2.4
- pip:
- sphinx_bootstrap_theme
- sphinxcontrib-bibtex
- sphinxcontrib-tikz
- coveralls
- pytest-html==1.10.0
- dokuwiki
- dot2tex
Expand Down