Skip to content

Export coverage report to workflow summary #5

Export coverage report to workflow summary

Export coverage report to workflow summary #5

Workflow file for this run

name: Run Unit Test via Pytest
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Setup environment
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config virtualenvs.in-project true
- name: Install dependencies
run: poetry install --with tests
- name: Test with pytest
run: |
poetry run coverage run -m pytest -v -s
- name: Generate coverage report
run: |
poetry run coverage report -m
- name: Export coverage report
run: |
poetry run coverage xml -o report.xml
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: report.xml
format: markdown
indicators: true
output: both
- name: Write summary
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY