Skip to content

Commit d3020f7

Browse files
committed
Add code coverage to test runs
1 parent ec460eb commit d3020f7

File tree

7 files changed

+83
-0
lines changed

7 files changed

+83
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Upload coverage
2+
3+
on:
4+
workflow_run:
5+
workflows: ['Code Tests', 'Geopandas tests', 'Code Tests with Latest branca', 'Selenium Tests', 'Run Snapshot Tests', 'Run Streamlit Folium Tests']
6+
types: [completed]
7+
8+
jobs:
9+
run:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Download coverage files from previous steps
14+
id: download-artifacts
15+
uses: actions/download-artifact@v4
16+
with:
17+
path: combined-coverage
18+
pattern: coverage-*
19+
merge-multiple: true
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Combine coverage
23+
run: coverage combine
24+
25+
- name: Generate report
26+
run: coverage html --skip-covered
27+
28+
- name: Upload coverage report
29+
if: always()
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: combined-coverage
33+
path: htmlcov/**
34+
fail-on-empty: false

.github/workflows/test_code.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,11 @@ jobs:
4242
4343
- name: Code tests
4444
run: coverage run -p -m pytest -vv --ignore=tests/selenium --ignore=tests/playwright --ignore=tests/snapshots
45+
46+
- name: Upload coverage
47+
if: always()
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: coverage-test-code
51+
path: |
52+
.coverage*

.github/workflows/test_geopandas.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,11 @@ jobs:
4747
run: |
4848
cd geopandas
4949
coverage run -p -m pytest -r a geopandas/tests/test_explore.py
50+
51+
- name: Upload coverage
52+
if: always()
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: coverage-test-geopandas
56+
path: |
57+
.coverage*

.github/workflows/test_latest_branca.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,11 @@ jobs:
3434
micromamba remove branca --yes --force
3535
python -m pip install git+https://github.com/python-visualization/branca.git
3636
coverage run -p -m pytest -vv --ignore=tests/selenium --ignore=tests/playwright --ignore=tests/snapshots
37+
38+
- name: Upload coverage
39+
if: always()
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: coverage-test-branca
43+
path: |
44+
.coverage*

.github/workflows/test_selenium.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,11 @@ jobs:
3535
- name: Selenium tests
3636
shell: bash -l {0}
3737
run: coverage run -p -m pytest tests/selenium -vv
38+
39+
- name: Upload coverage
40+
if: always()
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: coverage-test-selenium
44+
path: |
45+
.coverage*

.github/workflows/test_snapshots.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,11 @@ jobs:
5353
path: |
5454
/tmp/screenshot_*_*.png
5555
/tmp/folium_map_*.html
56+
57+
- name: Upload coverage
58+
if: always()
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: coverage-test-snapshots
62+
path: |
63+
.coverage*

.github/workflows/test_streamlit_folium.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,12 @@ jobs:
7474
with:
7575
path: streamlit_folium/test-results.xml
7676
fail-on-empty: false
77+
78+
79+
- name: Upload coverage
80+
if: always()
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: coverage-test-streamlit-folium
84+
path: |
85+
.coverage*

0 commit comments

Comments
 (0)