@@ -197,7 +197,7 @@ jobs:
197197 if : |
198198 github.event_name == 'release' &&
199199 startsWith(github.ref, 'refs/tags/tools/projmgr/')
200- needs : [ build, build-swig, unittest, coverage ]
200+ needs : [ build, build-swig, unittest ]
201201 runs-on : ubuntu-22.04
202202 timeout-minutes : 15
203203
@@ -335,25 +335,6 @@ jobs:
335335 overwrite : true
336336 asset_name : testreport.zip
337337
338- - name : Download coverage report
339- uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
340- with :
341- name : coverage-report-projmgr
342- path : tools/coverage/
343-
344- - name : Zip coverage reports
345- run : zip -r coverage.zip coverage_projmgr
346- working-directory : tools/coverage
347-
348- - name : Attach coverage archive to release assets
349- uses : svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # v2
350- with :
351- repo_token : ${{ secrets.GITHUB_TOKEN }}
352- file : tools/coverage/coverage.zip
353- tag : ${{ github.ref }}
354- overwrite : true
355- asset_name : coverage.zip
356-
357338 unittest :
358339 needs : [ setup, matrix_prep ]
359340 runs-on : ${{ matrix.runs_on }}
@@ -406,104 +387,6 @@ jobs:
406387 retention-days : ${{ needs.setup.outputs.retention_days }}
407388 if-no-files-found : error
408389
409- coverage :
410- if : |
411- (github.event_name == 'pull_request') ||
412- (github.event_name == 'workflow_dispatch') ||
413- (github.event_name == 'push') ||
414- (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/tools/projmgr/')) ||
415- ((github.event.schedule != '') && (!github.event.repository.private))
416- env :
417- lcov_base : https://github.com/linux-test-project/lcov/releases/download/v1.15/
418- lcov_installer : lcov-1.15.tar.gz
419- runs-on : ubuntu-22.04
420- timeout-minutes : 15
421- steps :
422- - name : Harden Runner
423- if : ${{ !github.event.repository.private }}
424- uses : step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
425- with :
426- egress-policy : audit
427-
428- - name : Install linux deps
429- run : |
430- sudo apt-get update
431- sudo apt-get install \
432- lcov
433-
434- - name : Checkout devtools
435- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
436- with :
437- submodules : true
438-
439- # https://github.com/Open-CMSIS-Pack/devtools-build-action
440- - name : Build ProjMgrUnitTests
441- uses : Open-CMSIS-Pack/devtools-build-action@1f131b70796337c98d4f680632bb4135d90f17f0 # arm64
442- with :
443- add_cmake_variables : -DCOVERAGE=ON
444- arch : amd64
445- build_type : Debug
446- target : ProjMgrUnitTests
447-
448- - name : Run ProjMgrUnitTests
449- run : |
450- ctest -V -C Debug -R ProjMgrUnitTests
451- working-directory : ./build
452-
453- - name : Get retention days
454- id : var
455- run : |
456- echo "retention_days=$(echo '${{ (!github.event.repository.private && (github.event_name == 'push' || github.event.schedule != '')) && '7' || '1' }}')" >> $GITHUB_OUTPUT
457-
458- - name : Archive test report
459- if : (github.event_name == 'push')
460- uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
461- with :
462- name : unit_test_result_projmgr-linux-amd64
463- path : ./build/test_reports/projmgrunittests-*.xml
464- retention-days : ${{ steps.var.outputs.retention_days }}
465- if-no-files-found : error
466-
467- # Needs to be removed once the bug is resolved
468- # lcov reporting 1.14 on 1.15 version
469- # https://groups.google.com/g/linux.debian.bugs.dist/c/a9SZGCENJ2s?pli=1
470- - name : Setup lcov1.15
471- run : |
472- wget -q ${{ env.lcov_base }}/${{ env.lcov_installer }}
473- tar -xvf ${{ env.lcov_installer }}
474- working-directory : ./build/tools/projmgr
475-
476- - name : Generate coverage report
477- run : |
478- lcov-1.15/bin/lcov --rc lcov_branch_coverage=1 --rc geninfo_no_exception_branch=1 -c --directory . --output-file full_coverage.info
479- lcov-1.15/bin/lcov --rc lcov_branch_coverage=1 --rc geninfo_no_exception_branch=1 -e full_coverage.info '/tools/projmgr/include/*' '*/tools/projmgr/src/*' -o coverage_projmgr.info
480- genhtml coverage_projmgr.info --output-directory coverage_projmgr --branch-coverage
481- working-directory : ./build/tools/projmgr/
482-
483- - name : Upload Report to Codecov
484- if : ${{ !github.event.repository.private }}
485- uses : Wandalen/wretry.action@e68c23e6309f2871ca8ae4763e7629b9c258e1ea # v3.8.0
486- with :
487- action : codecov/codecov-action@v4
488- with : |
489- files: ./build/tools/projmgr/coverage_projmgr.info
490- fail_ci_if_error: true
491- flags: projmgr-cov
492- token: ${{ secrets.CODECOV_TOKEN }}
493- verbose: true
494- attempt_limit : 3
495- attempt_delay : 5000
496-
497- - name : Archive coverage report
498- uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
499- with :
500- name : coverage-report-projmgr
501- path : |
502- ./build/tools/projmgr/coverage_projmgr/
503- ./build/tools/projmgr/coverage_projmgr.info
504- retention-days : ${{ steps.var.outputs.retention_days }}
505- if-no-files-found : error
506-
507390 test-results-preparation :
508391 name : " Publish Tests Results"
509392 needs : [ unittest ]
0 commit comments