Skip to content

Commit

Permalink
revamping CI (iiasa#153)
Browse files Browse the repository at this point in the history
This PR removes our depedence on circleci, which should fix our CI issues. Also adds nightly builds on travis. Once travis windows support gets better, we can also drop appveyor.
  • Loading branch information
gidden committed Jan 19, 2019
1 parent b11e6b8 commit 7c23322
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 71 deletions.
45 changes: 0 additions & 45 deletions .circleci/config.yml

This file was deleted.

55 changes: 29 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,43 @@
language: minimal

matrix:
include:
- os: linux
env: PYENV=py37
- os: linux
env: PYENV=py27
- os: osx
language: generic
env: TOXENV=py27
env: PYENV=py37
- os: osx
language: generic
env: TOXENV=py36
env: PYENV=py27
# turn these on once travis support gets a little better
# - os: windows
# env: PYENV=py37
# - os: windows
# env: PYENV=py27

before_install:
# install gams
- curl -O https://d37drm4t2jghv5.cloudfront.net/distributions/25.1.1/macosx/osx_x64_64_sfx.exe;
- chmod u+x osx_x64_64_sfx.exe
- ./osx_x64_64_sfx.exe > install.out
- export PATH=$PATH:$PWD/gams25.1_osx_x64_64_sfx
# install conda
- export MINICONDA=$HOME/miniconda
- export PATH="$MINICONDA/bin:$PATH"
- hash -r
- if [ $TOXENV == 'py27'];
then wget http:https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh -O miniconda.sh;
else wget http:https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
fi
- chmod +x miniconda.sh
- ./miniconda.sh -b -f -p $MINICONDA
- conda update --yes conda
# install ixmp deps
- conda install --yes -c conda-forge ixmp xlsxwriter xlrd
- conda remove --force --yes ixmp
- source ./ci/env.sh
- bash ./ci/travis-install.sh
- source activate testing

install:
- git clone https://github.com/iiasa/ixmp.git
- cd ixmp && python setup.py install && cd ..
- python setup.py install

script:
- conda install --yes -c conda-forge pytest
- pytest -v tests
- python -c "import os, sys; assert os.environ['PYVERSION'] == sys.version[0]"
- cd tests
- py.test --verbose --cov=message_ix --cov-config ../ci/.coveragerc --cov-report term-missing
- cd ..
- cd tests/ci
- if [[ ! -z "${MESSAGE_IX_CI_USER}" ]]; then ./run_on_ci.sh; fi
- cd ../..
- messageix-config --model_path=message_ix/model
- cd doc && pip install -r requirements.txt && make html
- cd doc
- pip install -r requirements.txt
- make html

after_success:
- coveralls
3 changes: 3 additions & 0 deletions ci/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[report]
omit =
message_ix/model/*
51 changes: 51 additions & 0 deletions ci/env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# gams info
case "${TRAVIS_OS_NAME}" in
linux)
OSFIX=linux
GAMSPATH=linux_x64_64_sfx
;;
osx)
OSFIX=macosx
GAMSPATH=osx_x64_64_sfx
;;
windows)
OSFIX=windows
GAMSPATH=windows_x64_64
;;
esac

GAMS_VERSION_SHORT=25.1
GAMS_VERSION_LONG=25.1.1

export GAMSFNAME=$GAMSPATH.exe
export GAMSURL=https://d37drm4t2jghv5.cloudfront.net/distributions/$GAMS_VERSION_LONG/$OSFIX/$GAMSFNAME
export PATH=$PATH:$PWD/gams"$GAMS_VERSION_SHORT"_"$GAMSPATH"

# miniconda info
case "${TRAVIS_OS_NAME}" in
linux)
OSNAME=Linux
EXT=sh
;;
osx)
OSNAME=MacOSX
EXT=sh
;;
windows)
OSNAME=Windows
EXT=exe
;;
esac

case "${PYENV}" in
py27)
export PYVERSION=2
;;
py37)
export PYVERSION=3
;;
esac

export CONDAURL="https://repo.anaconda.com/miniconda/Miniconda$PYVERSION-latest-$OSNAME-x86_64.$EXT"
export PATH=$HOME/miniconda/bin:$PATH

30 changes: 30 additions & 0 deletions ci/travis-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
set -x
set -e

# install gams
echo "Starting download from $GAMSURL"
wget $GAMSURL
echo "Download complete from $GAMSURL"
chmod u+x $GAMSFNAME
./$GAMSFNAME > install.out
which gams

# install and update conda
echo "Starting download from $CONDAURL"
wget $CONDAURL -O miniconda.sh
echo "Download complete from $CONDAURL"
chmod +x miniconda.sh
./miniconda.sh -b -p $HOME/miniconda
conda update --yes conda

# create named env
conda create -n testing python=$PYVERSION --yes

# install deps
conda install -n testing -c conda-forge --yes \
ixmp \
pytest \
coveralls \
pytest-cov
conda remove -n testing --force --yes ixmp

0 comments on commit 7c23322

Please sign in to comment.