Skip to content

Commit

Permalink
🏗 Use LLVM apt script directly to install full Clang toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
GHF committed Nov 16, 2023
1 parent e94e8e1 commit 0f45bfe
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
- coverage: ON
include:
- compiler: Clang
version: 17
- compiler: GCC
version: latest
- std: 20
Expand All @@ -28,7 +27,6 @@ jobs:
test_with_cxx23: ON
- compiler: Clang
std: 23
version: 17
test_with_cxx23: ON
coverage: ON

Expand All @@ -37,10 +35,17 @@ jobs:

- name: Set up Clang
if: matrix.compiler == 'Clang'
uses: egor-tensin/setup-clang@v1
with:
version: ${{ matrix.version }}
cc: 1
env:
CLANG_VERSION: ${{ vars.CLANG_VERSION }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh $CLANG_VERSION all
sudo ln -f -s /usr/bin/clang-$CLANG_VERSION /usr/local/bin/cc
sudo ln -f -s /usr/bin/clang++-$CLANG_VERSION /usr/local/bin/c++
sudo ln -f -s /usr/bin/ld.lld-$CLANG_VERSION /usr/local/bin/ld
sudo ln -f -s /usr/bin/llvm-profdata-$CLANG_VERSION /usr/local/bin/llvm-profdata
sudo ln -f -s /usr/bin/llvm-cov-$CLANG_VERSION /usr/local/bin/llvm-cov
- name: Set up GCC
if: matrix.compiler == 'GCC'
Expand All @@ -65,8 +70,8 @@ jobs:
if: matrix.coverage == 'ON'
working-directory: ${{github.workspace}}/build
run: |
llvm-profdata-${{ matrix.version }} merge -sparse default.profraw -o coverage.profdata
llvm-cov-${{ matrix.version }} show ./mays_tests -instr-profile=coverage.profdata > coverage.txt
llvm-profdata merge -sparse default.profraw -o coverage.profdata
llvm-cov show ./mays_tests -instr-profile=coverage.profdata > coverage.txt
- name: Upload coverage data to Codecov
uses: codecov/codecov-action@v2
Expand Down

0 comments on commit 0f45bfe

Please sign in to comment.