@@ -7,14 +7,20 @@ on: [workflow_call]
77permissions :
88 contents : read
99
10+ env :
11+ BUILD_DIR : " ${{github.workspace}}/build"
12+ INSTL_DIR : " ${{github.workspace}}/../install-dir"
13+ COVERAGE_DIR : " ${{github.workspace}}/coverage"
14+ COVERAGE_NAME : " exports-coverage-fuzztests"
15+
1016jobs :
1117 fuzz-test :
1218 name : Fuzz test
1319 strategy :
1420 fail-fast : false
1521 matrix :
1622 build_type : [Debug, Release]
17- compiler : [{c: clang , cxx: clang ++}]
23+ compiler : [{c: gcc , cxx: g ++}]
1824
1925 runs-on : ubuntu-latest
2026
@@ -39,10 +45,27 @@ jobs:
3945 -DUMF_TESTS_FAIL_ON_SKIP=ON
4046 -DUMF_DEVELOPER_MODE=ON
4147 -DUMF_BUILD_FUZZTESTS=ON
48+ ${{ matrix.build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}
4249
4350 - name : Build
4451 run : cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} --verbose -j$(nproc)
4552
4653 - name : Fuzz long test
4754 working-directory : ${{github.workspace}}/build
4855 run : ctest -C ${{matrix.build_type}} --output-on-failure --verbose -L "fuzz-long"
56+
57+ - name : Check coverage
58+ if : ${{ matrix.build_type == 'Debug' }}
59+ working-directory : ${{env.BUILD_DIR}}
60+ run : |
61+ export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}
62+ echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
63+ ../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
64+ mkdir -p ${{env.COVERAGE_DIR}}
65+ mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
66+
67+ - uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
68+ if : ${{ matrix.build_type == 'Debug' }}
69+ with :
70+ name : ${{env.COVERAGE_NAME}}
71+ path : ${{env.COVERAGE_DIR}}
0 commit comments