forked from IAMconsortium/pyam
-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (45 loc) · 1.59 KB
/
pytest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# 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.9'
- '3.8'
# Remove dependency `importlib_metadata` when dropping support for Python 3.7
- '3.7'
fail-fast: false
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} py${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and package
run: pip install -e .[tests,optional_plotting,optional_io_formats,tutorials]
- name: Test with pytest
if: ${{ matrix.python-version != '3.9' }}
run: pytest tests
# only execute Matplotlib tests on latest Python version
- name: Test with pytest including Matplotlib & Codecov
if: ${{ matrix.python-version == '3.9' }}
run: pytest tests --mpl --cov=./ --cov-report=xml
- name: Upload coverage report to Codecov
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' }}
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
env_vars: ${{ matrix.os }} py${{ matrix.python-version }}