Skip to content

Commit

Permalink
ci: add builds with all supported sanitizers.
Browse files Browse the repository at this point in the history
This way, tests will be run with sanitizers as well. Since including a
sanitizer in static binaries isn't recommended (doesn't work with LLVM,
with GCC requires a special flag), we include the sanitizer flags in the
same matrix group as linking flags.
  • Loading branch information
ericonr committed Jan 9, 2025
1 parent 4477340 commit 9f17962
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
container:
image: ${{ matrix.distro.image }}
env:
LDFLAGS: ${{ matrix.linking.ldflags }}
LDFLAGS: ${{ matrix.link-n-sane.ldflags }}
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
strategy:
Expand All @@ -24,9 +24,13 @@ jobs:
compiler:
- { cc: gcc, cxx: g++ }
- { cc: clang, cxx: clang++ }
linking:
- { ldflags: "" }
- { ldflags: "-static" }
link-n-sane:
- { ldflags: "", sanitizer: "none" }
- { ldflags: "-static", sanitizer: "none" }
- { sanitizer: "address,undefined" }
- { sanitizer: "thread" }
- { sanitizer: "memory" }
- { sanitizer: "leak" }
options:
- { pcie_opt: "true" }
- { pcie_opt: "false" }
Expand All @@ -37,7 +41,7 @@ jobs:
with:
submodules: true
- name: Configure
run: meson setup --buildtype release --werror -Dpcie_opt=${{ matrix.options.pcie_opt }} build || cat build/meson-logs/meson-log.txt /nonexistent
run: meson setup --buildtype release --werror -Dpcie_opt=${{ matrix.options.pcie_opt }} -Db_sanitize=${{ matrix.link-n-sane.sanitizer }} build || cat build/meson-logs/meson-log.txt /nonexistent
- name: Build
run: ninja -C build
- name: Run tests
Expand Down

0 comments on commit 9f17962

Please sign in to comment.