@@ -163,7 +163,7 @@ jobs:
163163 if : |
164164 github.event_name == 'release' &&
165165 startsWith(github.ref, 'refs/tags/tools/projmgr/')
166- needs : [ build, build-swig, unittest, coverage ]
166+ needs : [ build, build-swig, unittest ]
167167 runs-on : ubuntu-22.04
168168 timeout-minutes : 15
169169
@@ -291,25 +291,6 @@ jobs:
291291 overwrite : true
292292 asset_name : testreport.zip
293293
294- - name : Download coverage report
295- uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
296- with :
297- name : coverage-report-projmgr
298- path : tools/coverage/
299-
300- - name : Zip coverage reports
301- run : zip -r coverage.zip coverage_projmgr
302- working-directory : tools/coverage
303-
304- - name : Attach coverage archive to release assets
305- uses : svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
306- with :
307- repo_token : ${{ secrets.GITHUB_TOKEN }}
308- file : tools/coverage/coverage.zip
309- tag : ${{ github.ref }}
310- overwrite : true
311- asset_name : coverage.zip
312-
313294 unittest :
314295 needs : [ setup, matrix_prep ]
315296 runs-on : ${{ matrix.runs_on }}
@@ -362,104 +343,6 @@ jobs:
362343 retention-days : ${{ needs.setup.outputs.retention_days }}
363344 if-no-files-found : error
364345
365- coverage :
366- if : |
367- (github.event_name == 'pull_request') ||
368- (github.event_name == 'workflow_dispatch') ||
369- (github.event_name == 'push') ||
370- (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/tools/projmgr/')) ||
371- ((github.event.schedule != '') && (!github.event.repository.private))
372- env :
373- lcov_base : https://github.com/linux-test-project/lcov/releases/download/v1.15/
374- lcov_installer : lcov-1.15.tar.gz
375- runs-on : ubuntu-22.04
376- timeout-minutes : 15
377- steps :
378- - name : Harden Runner
379- if : ${{ !github.event.repository.private }}
380- uses : step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
381- with :
382- egress-policy : audit
383-
384- - name : Install linux deps
385- run : |
386- sudo apt-get update
387- sudo apt-get install \
388- lcov
389-
390- - name : Checkout devtools
391- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
392- with :
393- submodules : true
394-
395- # https://github.com/Open-CMSIS-Pack/devtools-build-action
396- - name : Build ProjMgrUnitTests
397- uses : Open-CMSIS-Pack/devtools-build-action@f447c00e0c2a58681faacce9312ead5813f93888 # arm64
398- with :
399- add_cmake_variables : -DCOVERAGE=ON
400- arch : amd64
401- build_type : Debug
402- target : ProjMgrUnitTests
403-
404- - name : Run ProjMgrUnitTests
405- run : |
406- ctest -V -C Debug -R ProjMgrUnitTests
407- working-directory : ./build
408-
409- - name : Get retention days
410- id : var
411- run : |
412- echo "retention_days=$(echo '${{ (!github.event.repository.private && (github.event_name == 'push' || github.event.schedule != '')) && '7' || '1' }}')" >> $GITHUB_OUTPUT
413-
414- - name : Archive test report
415- if : (github.event_name == 'push')
416- uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
417- with :
418- name : unit_test_result_projmgr-linux-amd64
419- path : ./build/test_reports/projmgrunittests-*.xml
420- retention-days : ${{ steps.var.outputs.retention_days }}
421- if-no-files-found : error
422-
423- # Needs to be removed once the bug is resolved
424- # lcov reporting 1.14 on 1.15 version
425- # https://groups.google.com/g/linux.debian.bugs.dist/c/a9SZGCENJ2s?pli=1
426- - name : Setup lcov1.15
427- run : |
428- wget -q ${{ env.lcov_base }}/${{ env.lcov_installer }}
429- tar -xvf ${{ env.lcov_installer }}
430- working-directory : ./build/tools/projmgr
431-
432- - name : Generate coverage report
433- run : |
434- lcov-1.15/bin/lcov --rc lcov_branch_coverage=1 --rc geninfo_no_exception_branch=1 -c --directory . --output-file full_coverage.info
435- 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
436- genhtml coverage_projmgr.info --output-directory coverage_projmgr --branch-coverage
437- working-directory : ./build/tools/projmgr/
438-
439- - name : Upload Report to Codecov
440- if : ${{ !github.event.repository.private }}
441- uses : Wandalen/wretry.action@e68c23e6309f2871ca8ae4763e7629b9c258e1ea # v3.8.0
442- with :
443- action : codecov/codecov-action@v4
444- with : |
445- files: ./build/tools/projmgr/coverage_projmgr.info
446- fail_ci_if_error: true
447- flags: projmgr-cov
448- token: ${{ secrets.CODECOV_TOKEN }}
449- verbose: true
450- attempt_limit : 3
451- attempt_delay : 5000
452-
453- - name : Archive coverage report
454- uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
455- with :
456- name : coverage-report-projmgr
457- path : |
458- ./build/tools/projmgr/coverage_projmgr/
459- ./build/tools/projmgr/coverage_projmgr.info
460- retention-days : ${{ steps.var.outputs.retention_days }}
461- if-no-files-found : error
462-
463346 test-results-preparation :
464347 name : " Publish Tests Results"
465348 needs : [ unittest ]
0 commit comments