@@ -154,7 +154,7 @@ jobs:
154154 if : |
155155 github.event_name == 'release' &&
156156 startsWith(github.ref, 'refs/tags/tools/projmgr/')
157- needs : [ build, build-swig, unittest, coverage ]
157+ needs : [ build, build-swig, unittest ]
158158 runs-on : ubuntu-22.04
159159 timeout-minutes : 15
160160
@@ -282,25 +282,6 @@ jobs:
282282 overwrite : true
283283 asset_name : testreport.zip
284284
285- - name : Download coverage report
286- uses : actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
287- with :
288- name : coverage-report-projmgr
289- path : tools/coverage/
290-
291- - name : Zip coverage reports
292- run : zip -r coverage.zip coverage_projmgr
293- working-directory : tools/coverage
294-
295- - name : Attach coverage archive to release assets
296- uses : svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
297- with :
298- repo_token : ${{ secrets.GITHUB_TOKEN }}
299- file : tools/coverage/coverage.zip
300- tag : ${{ github.ref }}
301- overwrite : true
302- asset_name : coverage.zip
303-
304285 unittest :
305286 needs : [ setup, matrix_prep ]
306287 runs-on : ${{ matrix.runs_on }}
@@ -353,104 +334,6 @@ jobs:
353334 retention-days : ${{ needs.setup.outputs.retention_days }}
354335 if-no-files-found : error
355336
356- coverage :
357- if : |
358- (github.event_name == 'pull_request') ||
359- (github.event_name == 'workflow_dispatch') ||
360- (github.event_name == 'push') ||
361- (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/tools/projmgr/')) ||
362- ((github.event.schedule != '') && (!github.event.repository.private))
363- env :
364- lcov_base : https://github.com/linux-test-project/lcov/releases/download/v1.15/
365- lcov_installer : lcov-1.15.tar.gz
366- runs-on : ubuntu-22.04
367- timeout-minutes : 15
368- steps :
369- - name : Harden Runner
370- if : ${{ !github.event.repository.private }}
371- uses : step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
372- with :
373- egress-policy : audit
374-
375- - name : Install linux deps
376- run : |
377- sudo apt-get update
378- sudo apt-get install \
379- lcov
380-
381- - name : Checkout devtools
382- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
383- with :
384- submodules : true
385-
386- # https://github.com/Open-CMSIS-Pack/devtools-build-action
387- - name : Build ProjMgrUnitTests
388- uses : Open-CMSIS-Pack/devtools-build-action@f447c00e0c2a58681faacce9312ead5813f93888 # arm64
389- with :
390- add_cmake_variables : -DCOVERAGE=ON
391- arch : amd64
392- build_type : Debug
393- target : ProjMgrUnitTests
394-
395- - name : Run ProjMgrUnitTests
396- run : |
397- ctest -V -C Debug -R ProjMgrUnitTests
398- working-directory : ./build
399-
400- - name : Get retention days
401- id : var
402- run : |
403- echo "retention_days=$(echo '${{ (!github.event.repository.private && (github.event_name == 'push' || github.event.schedule != '')) && '7' || '1' }}')" >> $GITHUB_OUTPUT
404-
405- - name : Archive test report
406- if : (github.event_name == 'push')
407- uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
408- with :
409- name : unit_test_result_projmgr-linux-amd64
410- path : ./build/test_reports/projmgrunittests-*.xml
411- retention-days : ${{ steps.var.outputs.retention_days }}
412- if-no-files-found : error
413-
414- # Needs to be removed once the bug is resolved
415- # lcov reporting 1.14 on 1.15 version
416- # https://groups.google.com/g/linux.debian.bugs.dist/c/a9SZGCENJ2s?pli=1
417- - name : Setup lcov1.15
418- run : |
419- wget -q ${{ env.lcov_base }}/${{ env.lcov_installer }}
420- tar -xvf ${{ env.lcov_installer }}
421- working-directory : ./build/tools/projmgr
422-
423- - name : Generate coverage report
424- run : |
425- lcov-1.15/bin/lcov --rc lcov_branch_coverage=1 --rc geninfo_no_exception_branch=1 -c --directory . --output-file full_coverage.info
426- 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
427- genhtml coverage_projmgr.info --output-directory coverage_projmgr --branch-coverage
428- working-directory : ./build/tools/projmgr/
429-
430- - name : Upload Report to Codecov
431- if : ${{ !github.event.repository.private }}
432- uses : Wandalen/wretry.action@e68c23e6309f2871ca8ae4763e7629b9c258e1ea # v3.8.0
433- with :
434- action : codecov/codecov-action@v4
435- with : |
436- files: ./build/tools/projmgr/coverage_projmgr.info
437- fail_ci_if_error: true
438- flags: projmgr-cov
439- token: ${{ secrets.CODECOV_TOKEN }}
440- verbose: true
441- attempt_limit : 3
442- attempt_delay : 5000
443-
444- - name : Archive coverage report
445- uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
446- with :
447- name : coverage-report-projmgr
448- path : |
449- ./build/tools/projmgr/coverage_projmgr/
450- ./build/tools/projmgr/coverage_projmgr.info
451- retention-days : ${{ steps.var.outputs.retention_days }}
452- if-no-files-found : error
453-
454337 test-results-preparation :
455338 name : " Publish Tests Results"
456339 needs : [ unittest ]
0 commit comments