Skip to content

Add coverage report steps to test workflow and upload artifacts #8

Add coverage report steps to test workflow and upload artifacts

Add coverage report steps to test workflow and upload artifacts #8

Workflow file for this run

name: Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
UV_SYSTEM_PYTHON: 1
jobs:
test:
name: Test with ${{ matrix.python }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python: ["3.11", "3.12", "3.13"]
os: ["ubuntu-latest"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Get coverage report
uses: actions/download-artifact@v4
with:
name: coverage-report
- name: Test with pytest
run: uv run --all-extras --python ${{ matrix.python }} pytest --cov-append
- name: Save coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage.xml
coverage-report:
name: Coverage report
runs-on: ubuntu-latest
needs: test
steps:
- name: Get coverage report
uses: actions/download-artifact@v4
with:
name: coverage-report
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml