Skip to content

Commit

Permalink
ci: Fix gcovr bug when assembling coverage out of gcno files
Browse files Browse the repository at this point in the history
Ubuntu 20.04 ships gcovr 4.2, which seems unable to assemble coverage
files out of gcda/gcno files. For some reason it returns files with
0% lines always.

Assembling the files manually (as was done previously, running gcov
on each pair of gcda/gcno, then calling gcov) would be enough but
only if passed the -g flag. So instead let's follow macOS and Windows,
and use gcovr 6.0 through pip.
  • Loading branch information
amyspark committed Jun 4, 2023
1 parent c019e44 commit eea279f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
CXX=${CC/#gcc/g++}
sudo apt-add-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install $CC $CXX gcovr
sudo apt-get install $CC $CXX
echo "CC=$CC" >> $GITHUB_ENV
echo "CXX=$CXX" >> $GITHUB_ENV
echo "GCOV=${CC/#gcc/gcov}" >> $GITHUB_ENV
Expand All @@ -75,7 +75,7 @@ jobs:
rm llvm-snapshot.gpg.key
sudo apt-add-repository "deb https://apt.llvm.org/${{ matrix.os.name }}/ llvm-toolchain-${{ matrix.os.name }}${CC/#clang/} main"
sudo apt-get update
sudo apt-get install $CC gcovr
sudo apt-get install $CC
CXX=${CC/#clang/clang++}
echo "CC=$CC" >> $GITHUB_ENV
echo "CXX=$CXX" >> $GITHUB_ENV
Expand All @@ -95,10 +95,10 @@ jobs:
with:
lfs: true
submodules: true
- name: Setup Meson + Ninja
- name: Setup Meson + Ninja + gcovr
run: |
sudo python3 -m pip install --upgrade pip setuptools wheel
sudo python3 -m pip install meson ninja
sudo python3 -m pip install meson ninja gcovr
working-directory: ${{ runner.temp }}
- name: Version tools
run: |
Expand Down

0 comments on commit eea279f

Please sign in to comment.