Skip to content

Commit 3be31bd

Browse files
authored
CI: coverage upload fix (#219)
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
1 parent 526248a commit 3be31bd

File tree

2 files changed

+54
-97
lines changed

2 files changed

+54
-97
lines changed

.github/.codecov.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
codecov:
2-
notify:
3-
after_n_builds: 11
4-
51
comment:
62
require_changes: true
73
layout: "diff, files"

.github/workflows/analysis-coverage.yml

Lines changed: 54 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -170,25 +170,15 @@ jobs:
170170
kill -15 $(cat /tmp/_install_models.pid)
171171
timeout 3m tail --pid=$(cat /tmp/_install_models.pid) -f /dev/null
172172
cd nc_py_api
173-
coverage combine && coverage xml && coverage html
173+
coverage combine && coverage xml -o coverage_maria_${{ matrix.nextcloud }}_${{ matrix.python }}_${{ matrix.php-version }}.xml
174174
175-
- name: HTML coverage to artifacts
176-
uses: actions/upload-artifact@v3
175+
- name: Upload Codecov to artifacts
176+
uses: actions/upload-artifact@v4
177177
with:
178-
name: coverage_maria_${{ matrix.nextcloud }}_${{ matrix.python }}_${{ matrix.php-version }}
179-
path: nc_py_api/htmlcov
178+
name: coverage_maria_${{ matrix.nextcloud }}_${{ matrix.python }}_${{ matrix.php-version }}.xml
179+
path: nc_py_api/coverage_maria_${{ matrix.nextcloud }}_${{ matrix.python }}_${{ matrix.php-version }}.xml
180180
if-no-files-found: error
181181

182-
- name: Upload report to Codecov
183-
uses: codecov/codecov-action@v3
184-
with:
185-
token: ${{ secrets.CODECOV_TOKEN }}
186-
name: coverage_maria_${{ matrix.nextcloud }}_${{ matrix.python }}_${{ matrix.php-version }}
187-
file: coverage.xml
188-
fail_ci_if_error: true
189-
verbose: true
190-
working-directory: nc_py_api
191-
192182
- name: Upload NC logs
193183
if: always()
194184
uses: actions/upload-artifact@v3
@@ -332,25 +322,15 @@ jobs:
332322
kill -15 $(cat /tmp/_install_models.pid)
333323
timeout 3m tail --pid=$(cat /tmp/_install_models.pid) -f /dev/null
334324
cd nc_py_api
335-
coverage combine && coverage xml && coverage html
325+
coverage combine && coverage xml -o coverage_pgsql_${{ matrix.nextcloud }}_${{ matrix.python }}_${{ matrix.php-version }}.xml
336326
337-
- name: HTML coverage to artifacts
338-
uses: actions/upload-artifact@v3
327+
- name: Upload Codecov to artifacts
328+
uses: actions/upload-artifact@v4
339329
with:
340-
name: coverage_pgsql_${{ matrix.nextcloud }}_${{ matrix.python }}_${{ matrix.php-version }}
341-
path: nc_py_api/htmlcov
330+
name: coverage_pgsql_${{ matrix.nextcloud }}_${{ matrix.python }}_${{ matrix.php-version }}.xml
331+
path: nc_py_api/coverage_pgsql_${{ matrix.nextcloud }}_${{ matrix.python }}_${{ matrix.php-version }}.xml
342332
if-no-files-found: error
343333

344-
- name: Upload report to Codecov
345-
uses: codecov/codecov-action@v3
346-
with:
347-
token: ${{ secrets.CODECOV_TOKEN }}
348-
name: coverage_pgsql_${{ matrix.nextcloud }}_${{ matrix.python }}_${{ matrix.php-version }}
349-
file: coverage.xml
350-
fail_ci_if_error: true
351-
verbose: true
352-
working-directory: nc_py_api
353-
354334
- name: Upload NC logs
355335
if: always()
356336
uses: actions/upload-artifact@v3
@@ -449,27 +429,17 @@ jobs:
449429
run: |
450430
coverage run --data-file=.coverage.ci -m pytest
451431
coverage run --data-file=.coverage.at_the_end -m pytest tests/_tests_at_the_end.py
452-
coverage combine && coverage xml && coverage html
432+
coverage combine && coverage xml -o coverage_oci_stable27_3.11_8.1.xml
453433
env:
454434
SKIP_NC_CLIENT_TESTS: 1
455435

456-
- name: HTML coverage to artifacts
457-
uses: actions/upload-artifact@v3
436+
- name: Upload Codecov to artifacts
437+
uses: actions/upload-artifact@v4
458438
with:
459-
name: coverage_oci_stable27_3.11_8.1
460-
path: nc_py_api/htmlcov
439+
name: coverage_oci_stable27_3.11_8.1.xml
440+
path: nc_py_api/coverage_oci_stable27_3.11_8.1.xml
461441
if-no-files-found: error
462442

463-
- name: Upload report to Codecov
464-
uses: codecov/codecov-action@v3
465-
with:
466-
token: ${{ secrets.CODECOV_TOKEN }}
467-
name: coverage_oci_stable27_3.11_8.1
468-
file: coverage.xml
469-
fail_ci_if_error: true
470-
verbose: true
471-
working-directory: nc_py_api
472-
473443
- name: Upload NC logs
474444
if: always()
475445
uses: actions/upload-artifact@v3
@@ -628,25 +598,15 @@ jobs:
628598
kill -15 $(cat /tmp/_install_models.pid)
629599
timeout 3m tail --pid=$(cat /tmp/_install_models.pid) -f /dev/null
630600
cd nc_py_api
631-
coverage combine && coverage xml && coverage html
601+
coverage combine && coverage xml -o coverage_maria_${{ matrix.nextcloud }}.xml
632602
633-
- name: HTML coverage to artifacts
634-
uses: actions/upload-artifact@v3
603+
- name: Upload Codecov to artifacts
604+
uses: actions/upload-artifact@v4
635605
with:
636-
name: coverage_maria_${{ matrix.nextcloud }}
637-
path: nc_py_api/htmlcov
606+
name: coverage_maria_${{ matrix.nextcloud }}.xml
607+
path: nc_py_api/coverage_maria_${{ matrix.nextcloud }}.xml
638608
if-no-files-found: error
639609

640-
- name: Upload report to Codecov
641-
uses: codecov/codecov-action@v3
642-
with:
643-
token: ${{ secrets.CODECOV_TOKEN }}
644-
name: coverage_maria_${{ matrix.nextcloud }}
645-
file: coverage.xml
646-
fail_ci_if_error: true
647-
verbose: true
648-
working-directory: nc_py_api
649-
650610
- name: Upload NC logs
651611
if: always()
652612
uses: actions/upload-artifact@v3
@@ -809,25 +769,15 @@ jobs:
809769
kill -15 $(cat /tmp/_install_models.pid)
810770
timeout 3m tail --pid=$(cat /tmp/_install_models.pid) -f /dev/null
811771
cd nc_py_api
812-
coverage combine && coverage xml && coverage html
772+
coverage combine && coverage xml -o coverage_pgsql_${{ matrix.nextcloud }}.xml
813773
814-
- name: HTML coverage to artifacts
815-
uses: actions/upload-artifact@v3
774+
- name: Upload Codecov to artifacts
775+
uses: actions/upload-artifact@v4
816776
with:
817-
name: coverage_pgsql_${{ matrix.nextcloud }}
818-
path: nc_py_api/htmlcov
777+
name: coverage_pgsql_${{ matrix.nextcloud }}.xml
778+
path: nc_py_api/coverage_pgsql_${{ matrix.nextcloud }}.xml
819779
if-no-files-found: error
820780

821-
- name: Upload report to Codecov
822-
uses: codecov/codecov-action@v3
823-
with:
824-
token: ${{ secrets.CODECOV_TOKEN }}
825-
name: coverage_pgsql_${{ matrix.nextcloud }}
826-
file: coverage.xml
827-
fail_ci_if_error: true
828-
verbose: true
829-
working-directory: nc_py_api
830-
831781
- name: Upload NC logs
832782
if: always()
833783
uses: actions/upload-artifact@v3
@@ -931,30 +881,18 @@ jobs:
931881

932882
- name: Generate coverage report
933883
working-directory: nc_py_api
934-
run: |
935-
coverage run -m pytest
936-
coverage xml && coverage html
884+
run: coverage run -m pytest && coverage xml -o coverage_sqlite_${{ matrix.nextcloud }}_client.xml
937885
env:
938886
SKIP_AA_TESTS: 1
939887
NPA_NC_CERT: ''
940888

941-
- name: HTML coverage to artifacts
942-
uses: actions/upload-artifact@v3
889+
- name: Upload Codecov to artifacts
890+
uses: actions/upload-artifact@v4
943891
with:
944-
name: coverage_sqlite_${{ matrix.nextcloud }}
945-
path: nc_py_api/htmlcov
892+
name: coverage_sqlite_${{ matrix.nextcloud }}_client.xml
893+
path: nc_py_api/coverage_sqlite_${{ matrix.nextcloud }}_client.xml
946894
if-no-files-found: error
947895

948-
- name: Upload report to Codecov
949-
uses: codecov/codecov-action@v3
950-
with:
951-
token: ${{ secrets.CODECOV_TOKEN }}
952-
name: coverage_sqlite_${{ matrix.nextcloud }}_client
953-
file: coverage.xml
954-
fail_ci_if_error: true
955-
verbose: true
956-
working-directory: nc_py_api
957-
958896
- name: Upload NC logs
959897
if: always()
960898
uses: actions/upload-artifact@v3
@@ -963,11 +901,34 @@ jobs:
963901
path: data/nextcloud.log
964902
if-no-files-found: warn
965903

904+
tests-upload-coverage:
905+
needs: [tests-maria, tests-pgsql, tests-stable27-oci, tests-latest-maria, test-latest-pgsql, tests-client-sqlite]
906+
permissions:
907+
contents: none
908+
runs-on: ubuntu-22.04
909+
name: Upload Coverage
910+
steps:
911+
- uses: actions/checkout@v4
912+
- name: Download Coverage Artifacts
913+
uses: actions/download-artifact@v4
914+
with:
915+
path: coverage
916+
pattern: coverage_*
917+
merge-multiple: true
918+
919+
- name: Upload report to Codecov
920+
uses: codecov/codecov-action@v3
921+
with:
922+
token: ${{ secrets.CODECOV_TOKEN }}
923+
directory: coverage
924+
fail_ci_if_error: true
925+
verbose: true
926+
966927
tests-success:
967928
permissions:
968929
contents: none
969930
runs-on: ubuntu-22.04
970-
needs: [tests-maria, tests-pgsql, tests-stable27-oci, tests-latest-maria, test-latest-pgsql, tests-client-sqlite]
931+
needs: [tests-upload-coverage]
971932
name: Tests-OK
972933
steps:
973934
- run: echo "Tests passed successfully"

0 commit comments

Comments
 (0)