From f736cbe07264dd47178ca7b6c3a03b94778cba28 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Wed, 12 Feb 2025 01:17:34 +0900 Subject: [PATCH 1/4] ci: add build with sanitizers --- .github/workflows/toml-test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/toml-test.yml b/.github/workflows/toml-test.yml index 449cff8..4e6ae8b 100644 --- a/.github/workflows/toml-test.yml +++ b/.github/workflows/toml-test.yml @@ -9,6 +9,11 @@ jobs: matrix: compiler: ['g++-12'] standard: ['11', '14', '17', '20'] + asan: ['ON', 'OFF'] + ubsan: ['ON', 'OFF'] + exclude: + - asan: 'ON' + ubsan: 'ON' steps: - name: Checkout uses: actions/checkout@v4 From 3d7a66ff71cbc96ba8f4c423eb85018ac686dea6 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Wed, 12 Feb 2025 01:17:52 +0900 Subject: [PATCH 2/4] ci: add build tests with sanitizers --- .github/workflows/main.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ef97e88..375dd68 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: From bc197bd600a5d408281648e2333290d570c370ce Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Wed, 12 Feb 2025 23:49:10 +0900 Subject: [PATCH 3/4] ci: enable sanitizers --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 375dd68..38c9028 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -62,7 +62,7 @@ jobs: 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 }} + 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 }} -DTOML11_TEST_WITH_ASAN=${{ matrix.asan }} -DTOML11_TEST_WITH_UBSAN=${{ matrix.ubsan }} - name: Build run: | cmake --build build/ -j${{ steps.cpu-cores.outputs.count }} From 48ad269cfb0c10df99a95cf90ea8c75f93866b11 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Thu, 13 Feb 2025 00:28:41 +0900 Subject: [PATCH 4/4] ci: turn sanitizers on --- .github/workflows/toml-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/toml-test.yml b/.github/workflows/toml-test.yml index 4e6ae8b..d8b343a 100644 --- a/.github/workflows/toml-test.yml +++ b/.github/workflows/toml-test.yml @@ -27,7 +27,7 @@ jobs: uses: actions/setup-go@v5 - name: Configure run: | - cmake -B build/ -DBUILD_TESTING=OFF -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} -DCMAKE_CXX_STANDARD=${{ matrix.standard }} -DTOML11_BUILD_TOML_TESTS=ON + cmake -B build/ -DBUILD_TESTING=OFF -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} -DCMAKE_CXX_STANDARD=${{ matrix.standard }} -DTOML11_BUILD_TOML_TESTS=ON -DTOML11_TEST_WITH_ASAN=${{ matrix.asan }} -DTOML11_TEST_WITH_UBSAN=${{ matrix.ubsan }} - name: Build run: | cmake --build build/