Testing on multiple operating systems with travis (#90)

* multiple os travis

* add coincbc via conda-forge

* switch to glpk

* circumvent windows subfolder snakemake path issue
cf. snakemake/snakemake/#46

* travis: skip solving for windows
This commit is contained in:
Fabian Neumann 2019-11-07 15:39:23 +01:00 committed by GitHub
parent e54119d878
commit 47d4882593
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 22 deletions

View File

@ -1,33 +1,25 @@
language: python
os:
- windows
- linux
- osx
python:
- "3.7"
language: bash
install:
# install system utilities
- sudo apt-get update --fix-missing
- sudo apt-get install -yq --no-install-recommends curl bzip2 xz-utils git ca-certificates coinor-cbc
before_install:
# install conda
# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/use-conda-with-travis-ci.html
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- source "$HOME/miniconda/etc/profile.d/conda.sh"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- wget https://raw.githubusercontent.com/trichter/conda4travis/latest/conda4travis.sh -O conda4travis.sh
- source conda4travis.sh
# install conda environment
- conda env create -f ./environment.yaml
- conda activate pypsa-eur
# install open-source solver
- conda install -c conda-forge ipopt
- conda install -c conda-forge ipopt glpk
script:
- cp ./test/config.test1.yaml ./config.yaml
- snakemake
- snakemake results/networks/elec_s_6_lcopt_Co2L-24H.nc
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then snakemake solve_all_elec_networks; fi
- rm -rf resources/*.nc resources/*.geojson resources/*.h5 networks results
# could repeat for more configurations in future

View File

@ -8,7 +8,7 @@ scenario:
sectors: [E]
simpl: ['']
ll: ['copt']
clusters: [2,6]
clusters: [5]
opts: [Co2L-24H]
countries: ['DE']
@ -158,7 +158,7 @@ solving:
clip_p_max_pu: 0.01
#nhours: 10
solver:
name: ipopt
name: glpk
# solver:
# name: gurobi
# threads: 4

View File

@ -9,7 +9,7 @@ scenario:
simpl: ['']
ll: ['copt']
clusters: [5]
opts: [Co2L-24H, 24H]
opts: [Co2L-24H]
countries: ['DE']
@ -158,7 +158,7 @@ solving:
clip_p_max_pu: 0.01
#nhours: 10
solver:
name: cbc
name: glpk
# solver:
# name: gurobi
# threads: 4