mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
[build] Add CMake build support for sanitizers (#3576)
* Address sanitizer uses -DCMAKE_BUILD_TYPE=Asan * Thread sanitizer uses -DCMAKE_BUILD_TYPE=Tsan * Undefined behavior sanitizer uses -DCMAKE_BUILD_TYPE=Ubsan Only ubsan is enabled in CI for now because asan and tsan report failures.
This commit is contained in:
37
.github/workflows/sanitizers.yml
vendored
Normal file
37
.github/workflows/sanitizers.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: Sanitizers
|
||||
|
||||
on: [pull_request, push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
#- name: asan
|
||||
# flags: "-DCMAKE_BUILD_TYPE=Asan"
|
||||
#- name: tsan
|
||||
# flags: "-DCMAKE_BUILD_TYPE=Tsan"
|
||||
- name: ubsan
|
||||
flags: "-DCMAKE_BUILD_TYPE=Ubsan"
|
||||
name: "${{ matrix.name }}"
|
||||
runs-on: ubuntu-latest
|
||||
container: wpilib/roborio-cross-ubuntu:2021-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||
sudo apt install -y gcc-11 g++-11
|
||||
sudo update-alternatives \
|
||||
--install /usr/bin/gcc gcc /usr/bin/gcc-11 11 \
|
||||
--slave /usr/bin/g++ g++ /usr/bin/g++-11
|
||||
sudo update-alternatives --set gcc /usr/bin/gcc-11
|
||||
- name: configure
|
||||
run: mkdir build && cd build && cmake ${{ matrix.flags }} ..
|
||||
- name: build
|
||||
working-directory: build
|
||||
run: make -j3
|
||||
- name: test
|
||||
working-directory: build
|
||||
run: ctest --output-on-failure
|
||||
Reference in New Issue
Block a user