feat: round coverage percentage

This commit is contained in:
Stijnvandenbroek
2026-03-11 13:32:37 +00:00
parent 18a05ab6d7
commit 6d0114aafc

View File

@@ -83,13 +83,18 @@ jobs:
- name: Run tests with coverage - name: Run tests with coverage
run: uv run pytest tests/ --cov=data_platform --cov-report=json:coverage.json run: uv run pytest tests/ --cov=data_platform --cov-report=json:coverage.json
- name: Round coverage percentage
if: github.ref == 'refs/heads/main'
run: |
COVERAGE=$(python -c "import json; print(round(json.load(open('coverage.json'))['totals']['percent_covered']))")
echo "COVERAGE=$COVERAGE" >> $GITHUB_ENV
- name: Generate coverage badge - name: Generate coverage badge
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main'
uses: jaywcjlove/coverage-badges-cli@v2.1.0 uses: jaywcjlove/coverage-badges-cli@v2.1.0
with: with:
source: coverage.json
output: badge/coverage-badge.svg output: badge/coverage-badge.svg
jsonPath: totals.percent_covered value: ${{ env.COVERAGE }}%
- name: Deploy coverage badge - name: Deploy coverage badge
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main'