Skip to content

Commit

Permalink
ci: Merge compiler-specific steps in the coverage jobs
Browse files Browse the repository at this point in the history
Now there's one step specific to gcc and one step specific to Clang.
  • Loading branch information
robinlinden committed Dec 13, 2023
1 parent 3a3921f commit 2bc8b9b
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,33 +124,28 @@ jobs:
path: ~/.cache/bazel
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
- name: Setup (gcc)
if: startsWith(matrix.compiler, 'gcc')
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
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
- name: Setup (clang)
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 }}
echo "CC=clang-16" >> $GITHUB_ENV
echo "CXX=clang++-16" >> $GITHUB_ENV
# 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 ... ${{ matrix.bazel }}
- name: Summary
Expand Down

0 comments on commit 2bc8b9b

Please sign in to comment.