Skip to content

Commit

Permalink
Merge pull request #596 from elbeno/enable-sanitizers
Browse files Browse the repository at this point in the history
👷 Fix GCC sanitizers
  • Loading branch information
lukevalenty authored Aug 12, 2024
2 parents 12f434a + f401538 commit 0b5b9d5
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,18 @@ jobs:
fail-fast: false
matrix:
sanitizer: [undefined, address, thread]
compiler: [clang]
compiler: [clang, gcc]
include:
- compiler: clang
cc: "clang"
cxx: "clang++"
install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 18
toolchain_root: "/usr/lib/llvm-18"
- compiler: gcc
cc: "gcc-13"
cxx: "g++-13"
install: sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && sudo apt update && sudo apt-get install -y gcc-13 g++-13
toolchain_root: "/usr"

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down Expand Up @@ -265,6 +270,13 @@ jobs:
path: ~/cpm-cache
key: ${{runner.os}}-${{env.cache-name}}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}

# https://github.com/actions/runner-images/issues/9524
- name: Fix kernel mmap rnd bits
# Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
# high-entropy ASLR in much newer kernels that GitHub runners are
# using leading to random crashes: https://reviews.llvm.org/D148280
run: sudo sysctl vm.mmap_rnd_bits=28

- name: Build Unit Tests
run: cmake --build ${{github.workspace}}/build -t unit_tests

Expand All @@ -274,7 +286,9 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Install build tools
run: sudo apt update && sudo apt install -y gcc-${{env.DEFAULT_GCC_VERSION}} g++-${{env.DEFAULT_GCC_VERSION}} ninja-build valgrind
run: |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt update && sudo apt-get install -y gcc-${{env.DEFAULT_GCC_VERSION}} g++-${{env.DEFAULT_GCC_VERSION}} ninja-build valgrind
- name: Restore CPM cache
env:
Expand Down

0 comments on commit 0b5b9d5

Please sign in to comment.