ci: add build tests with sanitizers

This commit is contained in:
ToruNiina
2025-02-12 01:17:52 +09:00
parent f736cbe072
commit 3d7a66ff71

View File

@@ -33,6 +33,43 @@ jobs:
- name: Test
run: |
ctest --output-on-failure --test-dir build/
build-linux-gcc-sanitizers:
runs-on: Ubuntu-22.04
strategy:
matrix:
compiler: ['g++-12']
standard: ['11', '14', '17', '20']
precompile: ['ON', 'OFF']
betafeature: ['ON', 'OFF']
asan: ['ON', 'OFF']
ubsan: ['ON', 'OFF']
exclude:
- asan: 'ON'
ubsan: 'ON'
steps:
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Install
run: |
sudo apt-get update
sudo apt-get install language-pack-fr # test serializer w/ locale
sudo apt-get install ${{ matrix.compiler }}
- name: Configure
run: |
cmake -B build/ -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} -DCMAKE_CXX_STANDARD=${{ matrix.standard }} -DTOML11_BUILD_TESTS=ON -DTOML11_PRECOMPILE=${{ matrix.precompile }} -DTOML11_ENABLE_ACCESS_CHECK=${{ matrix.betafeature }}
- name: Build
run: |
cmake --build build/ -j${{ steps.cpu-cores.outputs.count }}
- name: Test
run: |
ctest --output-on-failure --test-dir build/
build-linux-clang:
runs-on: Ubuntu-22.04
strategy: