GitHub actions CI (#252)

* add github action ci

* only one environment update call

* line break in echo did not work

* fix syntax

* fix version syntax

* switch to glpk

* reduce time from month to week

* list environment

* use new ipopt version
https://github.com/conda-forge/ipopt-feedstock/issues/55

* remove accidental additions

* request ipopt lower than 3.13.3
https://github.com/conda-forge/ipopt-feedstock/issues/64

* add badges and release notes

* add badge to readme and make ci.yaml cc-0
This commit is contained in:
Fabian Neumann 2021-06-22 11:01:33 +02:00 committed by GitHub
parent bfeb429c27
commit 7b68e8be0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 53 additions and 44 deletions

47
.github/workflows/ci.yaml vendored Normal file
View File

@ -0,0 +1,47 @@
# SPDX-FileCopyrightText: : 2021 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: CC0-1.0
name: CI
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 5
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2.1.1
with: # checks out environment 'test' by default
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
- name: Install dependencies
run: |
echo -ne "url: ${CDSAPI_URL}\nkey: ${CDSAPI_TOKEN}\n" > ~/.cdsapirc
echo -e " - glpk\n - ipopt<3.13.3" >> envs/environment.yaml
mamba env update -f envs/environment.yaml --name test
- name: Test snakemake workflow
run: |
conda list
cp test/config.test1.yaml config.yaml
snakemake -j all solve_all_networks
rm -rf resources/*.nc resources/*.geojson resources/*.h5 networks results

View File

@ -1,39 +0,0 @@
# SPDX-FileCopyrightText: : 2017-2020 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: GPL-3.0-or-later
branches:
only:
- master
os:
- windows
- linux
- osx
language: bash
before_install:
# install conda
- wget https://raw.githubusercontent.com/trichter/conda4travis/latest/conda4travis.sh -O conda4travis.sh
- source conda4travis.sh
# install conda environment
- conda install -c conda-forge mamba
- mamba env create -f ./envs/environment.yaml
- conda activate pypsa-eur
# install open-source solver
- mamba install -c conda-forge glpk ipopt'<3.13.3'
# list packages for easier debugging
- conda list
before_script:
- 'echo -ne "url: ${CDSAPI_URL}\nkey: ${CDSAPI_TOKEN}\n" > ~/.cdsapirc'
script:
- cp ./test/config.test1.yaml ./config.yaml
- snakemake -j all solve_all_networks
- rm -rf resources/*.nc resources/*.geojson resources/*.h5 networks results
# could repeat for more configurations in future

View File

@ -4,7 +4,7 @@ SPDX-License-Identifier: CC-BY-4.0
-->
![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/pypsa/pypsa-eur?include_prereleases)
[![Build Status](https://travis-ci.org/PyPSA/pypsa-eur.svg?branch=master)](https://travis-ci.org/PyPSA/pypsa-eur)
[![Build Status](https://github.com/pypsa/pypsa-eur/actions/workflows/ci.yaml/badge.svg)](https://github.com/PyPSA/pypsa-eur/actions)
[![Documentation](https://readthedocs.org/projects/pypsa-eur/badge/?version=latest)](https://pypsa-eur.readthedocs.io/en/latest/?badge=latest)
![Size](https://img.shields.io/github/repo-size/pypsa/pypsa-eur)
[![Zenodo](https://zenodo.org/badge/DOI/10.5281/zenodo.3520874.svg)](https://doi.org/10.5281/zenodo.3520874)

View File

@ -9,8 +9,8 @@ PyPSA-Eur: An Open Optimisation Model of the European Transmission System
.. image:: https://img.shields.io/github/v/release/pypsa/pypsa-eur?include_prereleases
:alt: GitHub release (latest by date including pre-releases)
.. image:: https://travis-ci.org/PyPSA/pypsa-eur.svg?branch=master
:target: https://travis-ci.org/PyPSA/pypsa-eur
.. image:: https://github.com/pypsa/pypsa-eur/actions/workflows/ci.yaml/badge.svg
:target: https://github.com/PyPSA/pypsa-eur/actions
.. image:: https://readthedocs.org/projects/pypsa-eur/badge/?version=latest
:target: https://pypsa-eur.readthedocs.io/en/latest/?badge=latest

View File

@ -22,6 +22,7 @@ Upcoming Release
* Fix: Add escape in :mod:`base_network` if all TYNDP links are already contained in the network [`#246 <https://github.com/PyPSA/pypsa-eur/pull/246>`_].
* Bugfix in :mod:`solve_operations_network`: optimised capacities are now fixed for all extendable links, not only HVDC links [`#244 <https://github.com/PyPSA/pypsa-eur/pull/244>`_].
* The ``focus_weights`` are now also considered when pre-clustering in the :mod:`simplify_network` rule [`#241 <https://github.com/PyPSA/pypsa-eur/pull/241>`_].
* Continuous integration testing switches to Github Actions from Travis CI [`#252 <https://github.com/PyPSA/pypsa-eur/pull/252>`_].
PyPSA-Eur 0.3.0 (7th December 2020)
==================================

View File

@ -20,7 +20,7 @@ countries: ['DE']
snapshots:
start: "2013-03-01"
end: "2014-04-01"
end: "2013-03-08"
closed: 'left' # end is not inclusive
enable:
@ -57,7 +57,7 @@ atlite:
module: era5
x: [4., 15.]
y: [46., 56.]
time: ["2013-03", "2013-03"]
time: ["2013-03-01", "2013-03-08"]
renewable:
onwind: