Skip to content

Merge branch 'dev' into features/costs_calculation #1368

Merge branch 'dev' into features/costs_calculation

Merge branch 'dev' into features/costs_calculation #1368

# Tests with pytest the package and monitors the covarage and sends it to coveralls.io
# Coverage is only send to coveralls.io when no pytest tests fail
name: "Tests & Coverage"
on: [push]
# Cancel jobs on new push
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
name: "${{ matrix.name-suffix }} at py${{ matrix.python-version }} on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name-suffix: "coverage"
os: ubuntu-latest
python-version: 3.8
- name-suffix: "basic"
os: ubuntu-latest
python-version: 3.9
- name-suffix: "basic"
os: windows-latest
python-version: 3.8
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up julia
if: runner.os == 'Linux'
uses: julia-actions/setup-julia@v1
with:
version: "1.6"
- name: Install packages (Linux)
if: runner.os == 'Linux'
run: |
pip install --upgrade pip wheel setuptools
pip install -e "."
- name: Install packages (Windows)
if: runner.os == 'Windows'
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: edisgo_env
environment-file: eDisGo_env_dev.yml
python-version: ${{ matrix.python-version }}
- name: Run tests Linux
if: runner.os == 'Linux' && matrix.name-suffix != 'coverage'
run: |
python -m pip install pytest pytest-notebook
python -m pytest --runslow --runonlinux --disable-warnings --color=yes -v
- name: Run tests Windows
if: runner.os == 'Windows'
run: |
python -m pip install pytest pytest-notebook
python -m pytest --runslow --disable-warnings --color=yes -v
- name: Run tests, coverage and send to coveralls
if: runner.os == 'Linux' && matrix.python-version == 3.8 && matrix.name-suffix == 'coverage'
run: |
pip install pytest pytest-notebook coveralls
coverage run --source=edisgo -m pytest --runslow --runonlinux --disable-warnings --color=yes -v
coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github