Skip to content

Publish coverage to sonarcloud #23

Publish coverage to sonarcloud

Publish coverage to sonarcloud #23

Workflow file for this run

name: Test coverage
on:
- pull_request
jobs:
coverage:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Check out source repository
uses: actions/checkout@v4
- name: Set up Python environment
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Set up Poetry
uses: Gr1N/setup-poetry@v9
with:
poetry-version: "1.8.2"
- name: Install dependencies
run: poetry install
- name: Run tests and generate coverage report
run: poetry run coverage run -m pytest
- name: Generate coverage report
run: poetry run coverage xml coverage.xml
- name: Get Cover
uses: orgoro/coverage@v3
with:
coverageFile: coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}