Skip to content

generate pytest.xml coverage report #169

generate pytest.xml coverage report

generate pytest.xml coverage report #169

Workflow file for this run

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.9', '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.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
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.0.1
with:
working-directory: centerline_width
token: ${{ secrets.CODECOV_TOKEN }}
slug: cyschneck/centerline-width
fail_ci_if_error: false