-
Notifications
You must be signed in to change notification settings - Fork 11
51 lines (42 loc) · 1.33 KB
/
pytests.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
name: pytests
on:
pull_request:
push:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest #ubuntu-20.04 # specifically calls the version number instead of latest to work on 'act'
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ['3.10', '3.11', '3.12']
name: Python (${{ matrix.python-version }} on ${{ matrix.os }})
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
- name: Test with pytest and generate coverage reports
run: |
python -m pytest --cov=./centerline_width --cov-report=xml --junitxml=pytest.xml
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: Test results for ${{ matrix.os }}-${{ matrix.python-version }}
path: pytest.xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: ./coverage.xml
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false