Skip to content

Commit

Permalink
try gcovr
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiud committed Oct 6, 2023
1 parent 6226706 commit b9ba43e
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit b9ba43e

Please sign in to comment.