From b9ba43e950cbe3f50ffec8c8cd410a98f4255a67 Mon Sep 17 00:00:00 2001 From: Sergiu Deitsch Date: Fri, 6 Oct 2023 22:42:05 +0200 Subject: [PATCH] try gcovr --- .github/workflows/macos.yml | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index d1c001e1b..7cb140f97 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -19,12 +19,18 @@ jobs: - name: Setup Dependencies run: | - brew install lcov ninja + brew install ninja + + - name: Setup Dependencies + if: matrix.build_type == 'Debug' + run: | + brew install gcovr - name: Setup Environment if: matrix.build_type == 'Debug' run: | echo 'CXXFLAGS=--coverage' >> $GITHUB_ENV + echo 'LDFLAGS=--coverage' >> $GITHUB_ENV - name: Configure shell: bash @@ -53,26 +59,14 @@ jobs: - name: Generate Coverage if: matrix.build_type == 'Debug' run: | - lcov --ignore-errors inconsistent --directory . --capture --output-file coverage.info - lcov --remove coverage.info \ - '*/src/*_unittest.cc' \ - '*/src/googletest.h' \ - '*/src/mock-log.h' \ - '*/usr/*' \ - --output-file coverage.info - - for file in src/glog/*.h.in; do - name=$(basename ${file}) - name_we=${name%.h.in} - sed -i "" "s|${{github.workspace}}/glog/${name_we}.h\$|${file}|g" coverage.info - done - - lcov --list coverage.info + cd build_${{matrix.build_type}} + gcovr -r .. --filter ../src/ . -s -o coverage.xml - name: Upload Coverage to Codecov if: matrix.build_type == 'Debug' uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} + files: build_${{matrix.build_type}}/coverage.xml fail_ci_if_error: true verbose: true