-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (45 loc) · 1.42 KB
/
tests.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
# this workflow runs unit tests and checks code style
# for different versions of python on different operating systems
name: tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
tests:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.py }})
strategy:
fail-fast: false
matrix:
config:
- { os: ubuntu-latest, py: "3.12" }
- { os: ubuntu-latest, py: "3.11" }
- { os: windows-latest, py: "3.10" }
- { os: macOS-latest, py: "3.10" }
- { os: ubuntu-latest, py: "3.10" }
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.config.py }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.config.py }}
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Install package
run: poetry install
- name: Test with pytest
run: poetry run pytest tests/ --cov=imf_reader --cov-report=xml
- name: Use Codecov to track coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml # coverage report
fail_ci_if_error: true
verbose: true
- name: Check code style
run: poetry run black src tests --check