diff --git a/.github/workflows/create-coverage-report.yml b/.github/workflows/create-coverage-report.yml index 9040a9cf0..2a5dea6c3 100644 --- a/.github/workflows/create-coverage-report.yml +++ b/.github/workflows/create-coverage-report.yml @@ -20,7 +20,7 @@ jobs: sudo apt-get install xorg-dev libglu1-mesa-dev gcc-11 g++-11 lcov - name: Configure CMake - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_COVERAGE=ON -DBUILD_CORE_TESTS=ON -DUSE_CLANG_TIDY=OFF + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_COVERAGE=ON -DBUILD_CORE_TESTS=ON -DBUILD_ENGINE_TESTS=ON -DUSE_CLANG_TIDY=OFF shell: bash env: CC: gcc-11 @@ -30,5 +30,10 @@ jobs: run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target coverage - name: Upload - run: bash <(curl -s https://codecov.io/bash) -f ${{github.workspace}}/build/coverage.info - + uses: codecov/codecov-action@v4 + with: + directory: ${{github.workspace}}/build/ + fail_ci_if_error: true + files: ./coverage-core.info,./coverage-engine.info + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true diff --git a/CMakeLists.txt b/CMakeLists.txt index c04077b1b..d11844d26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,14 +18,26 @@ if(ENABLE_COVERAGE) append_coverage_compiler_flags() setup_target_for_coverage_lcov( - NAME coverage + NAME coverage-core EXECUTABLE core/tests/cubos-core-tests DEPENDENCIES cubos-core-tests - EXCLUDE "core/lib/*" "core/tests/*" "tools/quadrados" "*-components.cpp" + EXCLUDE "core/lib/*" "core/tests/*" "engine/*" "lib/*" "tools/*" "*-components.cpp" LCOV_ARGS "--no-external" ) + + setup_target_for_coverage_lcov( + NAME coverage-engine + EXECUTABLE engine/tests/cubos-engine-tests + DEPENDENCIES cubos-engine-tests + + EXCLUDE "engine/lib/*" "engine/tests/*" "core/*" "lib/*" "tools/*" "*-components.cpp" + + LCOV_ARGS "--no-external" + ) + + add_custom_target(coverage DEPENDS coverage-core coverage-engine) endif() # Enable CCache