Skip to content

Commit d04a93d

Browse files
try adding coverage badge
1 parent 64406b9 commit d04a93d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/CI_first_code_checks.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,49 @@ jobs:
1414
first_check:
1515
name: first code check / python-3.13 / ubuntu-latest
1616
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write
1719
steps:
1820
- uses: actions/checkout@v4
1921
- name: Set up Python
2022
uses: actions/setup-python@v5
2123
with:
2224
python-version: '3.13'
25+
2326
- name: Python info
2427
run: |
2528
which python
2629
python --version
30+
2731
- name: Build package and create dev environment
2832
run: |
2933
python -m pip install --upgrade pip poetry
3034
poetry config virtualenvs.create false
3135
poetry install --with dev
36+
3237
- name: Show pip list
3338
run: |
3439
pip list
40+
3541
- name: Test with coverage
3642
run: |
3743
poetry run pytest --cov --cov-report term --cov-report xml --junitxml=xunit-result.xml
44+
3845
- name: Correct coverage paths
3946
run: sed -i "s+$PWD/++g" coverage.xml
47+
4048
- name: Run ruff linter
4149
run: ruff check --output-format=github
50+
51+
- name: Create coverage badge (SVG)
52+
run: |
53+
python -m pip install --upgrade genbadge[coverage]
54+
mkdir -p badges
55+
genbadge coverage -i coverage.xml -o docs/badges/coverage.svg
56+
57+
- name: Commit coverage badge on default branch
58+
if: github.ref == 'refs/heads/main'
59+
uses: stefanzweifel/git-auto-commit-action@v5
60+
with:
61+
commit_message: "ci: update coverage badge [skip ci]"
62+
file_pattern: docs/badges/coverage.svg

0 commit comments

Comments
 (0)