diff --git a/.github/workflows/code-cov.yml b/.github/workflows/code-cov.yml index 60c26cd..f2a8ed8 100644 --- a/.github/workflows/code-cov.yml +++ b/.github/workflows/code-cov.yml @@ -7,15 +7,15 @@ on: pull_request: jobs: - ubuntu-gcc-code-cov: + ubuntu-code-cov: runs-on: ubuntu-latest env: CMAKE_FLAGS: "-DSERDEPP_USE_NLOHMANN_JSON=ON -DSERDEPP_USE_TOML11=ON -DSERDEPP_USE_YAML-CPP=ON -DSERDEPP_USE_RAPIDJSON=ON -DSERDEPP_USE_FMT=ON -DSERDEPP_BUILD_TESTING=ON -DSERDEPP_USE_CATCH2=ON" strategy: matrix: build-type: ["Debug"] - gcc-version: ["latest"] - container: gcc:${{ matrix.gcc-version }} + compiler-version: ["latest"] + container: silkeh/clang:${{ matrix.compiler-version }} steps: - name: Get latest CMake uses: lukka/get-cmake@v3.27.7 @@ -33,13 +33,15 @@ jobs: cmake --build ./build --config ${{matrix.build-type}} - name: Run Test Script - working-directory: build - run: ctest -C ${{matrix.build-type}} --output-on-failure + working-directory: build/${{matrix.build-type}} + run: | + ./unittest + llvm-profdata merge -sparse default.profraw -o default.profdata + llvm-cov export ./unittest --instr-profile default.profdata -format=lcov >> coverage.info - name: Prepare Codecov run: | apt-get install -y lcov - lcov --directory . --capture --output-file coverage.info --rc lcov_branch_coverage=1 lcov --remove coverage.info '/usr/*' --output-file coverage.info --rc lcov_branch_coverage=1 lcov --remove coverage.info '**/tests/*' --output-file coverage.info --rc lcov_branch_coverage=1 lcov --remove coverage.info '**/.cppm/*' --output-file coverage.info --rc lcov_branch_coverage=1 diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f4e3a2..f4aee40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ cppm_setting() cppm_cxx_standard(17) cppm_compiler_option( DEBUG - CLANG "-fprofile-instr-generate -fcoverage-mapping" + CLANG "-fprofile-instr-generate -fcoverage-mapping --coverage" GCC "--coverage -fno-inline -fno-inline-small-functions -fno-default-inline" )