Skip to content

Commit c45c41e

Browse files
ChristianBeilschmidtCopilot
andcommitted
ci: enhance coverage reporting by uploading artifacts for backend and Python tests
Co-authored-by: Copilot <copilot@github.com>
1 parent bed7456 commit c45c41e

1 file changed

Lines changed: 42 additions & 37 deletions

File tree

.github/workflows/ci.yml

Lines changed: 42 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
name: "geoengine / test"
1818
runs-on: ubuntu-24.04
1919

20+
outputs:
21+
coverage-artifact-id: ${{ steps.upload-coverage-artifact.outputs.artifact-id }}
22+
2023
permissions:
2124
contents: read
2225

@@ -48,17 +51,14 @@ jobs:
4851
# key: ci_test_
4952
- name: Testsuite
5053
uses: ./.github/actions/test
51-
- name: Adjust lcov.info
52-
# The lcov file is generated in the container and contains absolute paths, so we need to adjust them.
53-
run: sed -i 's|/github/workspace/||g' geoengine/lcov.info
54-
- name: Upload coverage to Coveralls
55-
uses: coverallsapp/github-action@v2
54+
- id: upload-coverage-artifact
55+
uses: actions/upload-artifact@v7
5656
with:
57-
github-token: ${{ secrets.GITHUB_TOKEN }}
58-
file: geoengine/lcov.info
59-
fail-on-error: false # do not fail the workflow if the upload fails
60-
parallel: true
61-
flag-name: backend
57+
name: lcov-report-backend-${{ github.run_id }}-${{ github.run_attempt }}
58+
path: geoengine/lcov.info
59+
compression-level: 9
60+
retention-days: 3
61+
if-no-files-found: error
6262

6363
geoengine-lint:
6464
name: "geoengine / lint"
@@ -137,6 +137,9 @@ jobs:
137137
permissions:
138138
contents: read
139139

140+
outputs:
141+
coverage-artifact-id: ${{ steps.upload-coverage-artifact.outputs.artifact-id }}
142+
140143
strategy:
141144
fail-fast: false
142145
matrix:
@@ -193,20 +196,15 @@ jobs:
193196
just python run-examples
194197
--build-type=release
195198
${{ matrix.coverage && '--coverage' || '' }}
196-
- name: Adjust lcov.info
197-
if: ${{ matrix.coverage }}
198-
# The lcov file is generated in the container and contains relative paths from the python folder
199-
# so we need to adjust them to match the repository structure for coveralls.
200-
run: sed -i 's|SF:geoengine/|SF:python/geoengine/|' python/coverage.lcov
201-
- name: Upload coverage to Coveralls
199+
- id: upload-coverage-artifact
202200
if: ${{ matrix.coverage }}
203-
uses: coverallsapp/github-action@v2
201+
uses: actions/upload-artifact@v7
204202
with:
205-
github-token: ${{ secrets.GITHUB_TOKEN }}
206-
file: python/coverage.lcov
207-
fail-on-error: false # do not fail the workflow if the upload fails
208-
parallel: true
209-
flag-name: python
203+
name: lcov-report-python-${{ github.run_id }}-${{ github.run_attempt }}
204+
path: python/coverage.lcov
205+
compression-level: 9
206+
retention-days: 1
207+
if-no-files-found: error
210208

211209
www:
212210
runs-on: ubuntu-24.04
@@ -365,16 +363,7 @@ jobs:
365363
- run: just ui test --ci
366364
env:
367365
CI: true
368-
- name: Upload UI coverage artifact
369-
uses: actions/upload-artifact@v4
370-
with:
371-
name: ui-coverage
372-
path: |
373-
ui/coverage/**
374-
ui/**/coverage/**
375-
www/coverage/**
376-
coverage/**
377-
if-no-files-found: warn
366+
# TODO: coverage for UI tests
378367

379368
ui-lint:
380369
name: "ui / lint"
@@ -418,17 +407,33 @@ jobs:
418407
repository-coverage:
419408
name: "repository / coverage"
420409

421-
if: ${{ always() }}
422-
needs: [geoengine-test, python]
410+
needs:
411+
- geoengine-test
412+
- python
423413

424414
runs-on: ubuntu-24.04
425415

426416
permissions:
427417
contents: read
428418

429419
steps:
430-
- name: Close parallel coverage report
420+
- name: Checkout code
421+
uses: actions/checkout@v6
422+
- name: Download Backend Coverage Report
423+
uses: actions/download-artifact@v8
424+
with:
425+
artifact-ids: ${{ needs.geoengine-test.outputs.coverage-artifact-id }}
426+
path: geoengine/
427+
- name: Download Python Coverage Report
428+
uses: actions/download-artifact@v8
429+
with:
430+
artifact-ids: ${{ needs.python.outputs.coverage-artifact-id }}
431+
path: python/
432+
- name: Modify lcov paths
433+
run: |
434+
sed -i 's|/github/workspace/geoengine/||g' geoengine/lcov.info
435+
- name: Upload coverage to Coveralls
431436
uses: coverallsapp/github-action@v2
432437
with:
433-
parallel-finished: true
434-
carryforward: "backend,python"
438+
github-token: ${{ secrets.GITHUB_TOKEN }}
439+
fail-on-error: false # do not fail the workflow if the upload fails

0 commit comments

Comments
 (0)