Skip to content

Commit 64dc0f4

Browse files
committed
sepparate coverage job
1 parent c205a88 commit 64dc0f4

File tree

2 files changed

+4
-46
lines changed

2 files changed

+4
-46
lines changed

.github/workflows/tests.yaml

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -36,56 +36,11 @@ jobs:
3636
python -m tox
3737
3838
- name: List coverage files
39-
run: find . -name .coverage.*
39+
run: find . -name .coverage*
4040

4141
- name: Upload coverage data
4242
uses: actions/upload-artifact@v4
4343
with:
4444
name: covdata-${{ matrix.python-version }}
4545
path: ./.coverage
4646
if-no-files-found: warn
47-
48-
coverage:
49-
name: Generate coverage status badge
50-
needs: run_tests
51-
runs-on: ubuntu-latest
52-
steps:
53-
- name: Check out the repo
54-
uses: actions/checkout@v4
55-
56-
- name: Set up Python
57-
uses: actions/setup-python@v5
58-
with:
59-
python-version: 3.12
60-
61-
- name: Install dependencies
62-
run: |
63-
python -m pip install tox tox-gh-actions
64-
65-
- name: Download coverage data
66-
uses: actions/download-artifact@v4
67-
with:
68-
pattern: covdata-*
69-
merge-multiple: true
70-
71-
- name: List downloaded artifacts
72-
run: ls -la
73-
74-
- name: Combine coverage data
75-
run: |
76-
python -m tox -e coverage
77-
export TOTAL_COV=$(python -c "import json; print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
78-
echo total_cov=$TOTAL_COV >> $GITHUB_ENV
79-
echo ### Total coverage: ${TOTAL_COV}% >> $GITHUB_STEP_SUMMARY
80-
81-
- name: Generate coverage badge
82-
uses: schneegans/dynamic-badges-action@v1.7.0
83-
with:
84-
auth: ${{ secrets.GIST_TOKEN }}
85-
gistID: f6cec4c4c8e1733cfe45f807918a128a
86-
filename: covbadge.json
87-
label: coverage
88-
message: ${{ env.total_cov }}%
89-
minColorRange: 50
90-
maxColorRange: 90
91-
valColorRange: ${{ env.total_cov }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ src/pyconstclasses.egg-info/
1414
.pytest_cache/
1515
**/__pycache__/
1616

17+
# ci files
18+
!.github/*
19+
1720
# code coverage
1821
.coverage*
1922
coverage.*

0 commit comments

Comments
 (0)