Skip to content

Commit

Permalink
ci: Add a Clang 16 code coverage job
Browse files Browse the repository at this point in the history
  • Loading branch information
robinlinden committed Dec 13, 2023
1 parent 45a96dc commit 3a3921f
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ jobs:
include:
- compiler: gcc
version: 13
- compiler: clang
version: 16
bazel: --config=clang16-coverage
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -122,17 +125,34 @@ jobs:
key: coverage-${{ matrix.compiler }}-${{ matrix.version }}-${{ hashFiles('.bazelversion', 'WORKSPACE', 'third_party/**') }}
restore-keys: coverage-${{ matrix.compiler }}-${{ matrix.version }}-
- run: sudo add-apt-repository ppa:ubuntu-toolchain-r/test
if: startsWith(matrix.compiler, 'gcc')
- name: Install
if: startsWith(matrix.compiler, 'gcc')
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends libgl-dev lcov gcc-${{ matrix.version }} g++-${{ matrix.version }}
- name: Setup
if: startsWith(matrix.compiler, 'gcc')
run: |
echo "CC=gcc-${{ matrix.version }}" >> $GITHUB_ENV
echo "CXX=g++-${{ matrix.version }}" >> $GITHUB_ENV
echo "GCOV=gcov-${{ matrix.version }}" >> $GITHUB_ENV
- name: Install
if: startsWith(matrix.compiler, 'clang')
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${{ matrix.version }} main"
sudo apt-get update
sudo apt-get install --no-install-recommends libgl-dev lcov clang-${{ matrix.version }} libclang-rt-${{ matrix.version }}-dev llvm-${{ matrix.version }}
# See: https://github.com/actions/runner-images/issues/8659
sudo rm -f /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-jammy.list
sudo apt-get update
sudo apt-get install --allow-downgrades libstdc++6=12.3.0-1ubuntu1~22.04 libgcc-s1=12.3.0-1ubuntu1~22.04
- name: Setup
if: startsWith(matrix.compiler, 'clang')
run: echo "CC=clang-16" >> $GITHUB_ENV && echo "CXX=clang++-16" >> $GITHUB_ENV
- name: Coverage
run: bazel coverage ...
run: bazel coverage ... ${{ matrix.bazel }}
- name: Summary
run: lcov --summary bazel-out/_coverage/_coverage_report.dat
- name: Upload
Expand Down

0 comments on commit 3a3921f

Please sign in to comment.