Skip to content

Refactor tests for region-aggregation with weights #859

Refactor tests for region-aggregation with weights

Refactor tests for region-aggregation with weights #859

Workflow file for this run

# This workflow installs the package on several OS/Python versions and runs the tests
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: pytest
on:
push:
branches: [ 'main' ]
pull_request:
branches: [ '**' ]
jobs:
pytest:
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
python-version:
- '3.10'
- '3.11'
fail-fast: false
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} py${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and package
run: pip install .[tests,optional_plotting,optional_io_formats,tutorials]
# run tests without Matplotlib & CodeCode tests on earlier Python versions
- name: Test with pytest
if: ${{ matrix.python-version != '3.11' }}
run: pytest tests
# run tests with Matplotlib & CodeCov on latest Python version
- name: Test with pytest including Matplotlib & Codecov
if: ${{ matrix.python-version == '3.11' }}
run: pytest tests --mpl --cov=./ --cov-report=xml
- name: Upload coverage report to Codecov
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' }}
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
env_vars: ${{ matrix.os }} py${{ matrix.python-version }}