File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Update Coverage Badge
2+ on :
3+ push :
4+ branches : [master]
5+
6+ permissions :
7+ contents : write
8+
9+ jobs :
10+ update-badge :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v6
14+ with :
15+ persist-credentials : false
16+ fetch-depth : 0
17+
18+ - name : Set up Python
19+ uses : astral-sh/setup-uv@v7
20+ with :
21+ python-version : 3.13
22+
23+ - name : Install Dependencies
24+ run : uv sync --all-extras
25+
26+ - name : Run Tests
27+ run : uv run pytest --slow --cov=. --cov-report=xml:coverage.xml
28+
29+ - name : Coverage comment
30+ id : coverage
31+ uses : MishaKav/pytest-coverage-comment@v1.2.0
32+ with :
33+ pytest-xml-coverage-path : ./coverage.xml
34+ junitxml-path : ./pytest.xml
35+ hide-comment : true
36+
37+ - name : Update README
38+ run : |
39+ sed -i '/<!-- Pytest Coverage Comment:Begin -->/,/<!-- Pytest Coverage Comment:End -->/c\<!-- Pytest Coverage Comment:Begin -->\n${{ steps.coverage.outputs.coverageHtml }}\n<!-- Pytest Coverage Comment:End -->' ./README.md
40+
41+ - name : Commit changes
42+ uses : stefanzweifel/git-auto-commit-action@v7
43+ with :
44+ commit_message : " docs: update coverage badge"
45+ file_pattern : README.md
Original file line number Diff line number Diff line change 77 branches : [master]
88
99permissions :
10- contents : write
10+ contents : read
1111 pull-requests : write
1212
1313jobs :
4747 junitxml-path : ./pytest.xml
4848 unique-id-for-comment : ${{ matrix.python-version }}-${{ matrix.config.os }}
4949 title : Coverage for Python ${{ matrix.python-version }} on ${{ matrix.config.os }}
50-
51- - name : Update README
52- run : |
53- sed -i '/<!-- Pytest Coverage Comment:Begin -->/,/<!-- Pytest Coverage Comment:End -->/c\<!-- Pytest Coverage Comment:Begin -->\n${{ steps.coverage.outputs.coverageHtml }}\n<!-- Pytest Coverage Comment:End -->' ./README.md
54-
55- - name : Commit changes
56- uses : stefanzweifel/git-auto-commit-action@v7
57- with :
58- commit_message : " docs: update coverage badge"
59- file_pattern : README.md
You can’t perform that action at this time.
0 commit comments