From 4d48e26b0886b9d7d7c5c593d1fe92a52b923825 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Fri, 22 Nov 2024 14:26:35 +0000 Subject: [PATCH] CI: Move sanitizer output into a separate CI step Instead of writing ASAN and UBSAN output into the same stream we use for test logging, direct them to two log files, asan.log and ubsan.log, and then output them in a separate CI job that runs afterwards. This should hopefully make it easier to see which tests are failing, without losing any benefits. --- .github/workflows/lagom-template.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/lagom-template.yml b/.github/workflows/lagom-template.yml index 340ab6f11d82f..95b7d86535a45 100644 --- a/.github/workflows/lagom-template.yml +++ b/.github/workflows/lagom-template.yml @@ -185,6 +185,8 @@ jobs: run: ctest --preset Sanitizer --output-on-failure --test-dir Build env: TESTS_ONLY: 1 + ASAN_OPTIONS: 'log_path=asan.log' + UBSAN_OPTIONS: 'log_path=ubsan.log' - name: Upload LibWeb Test Artifacts if: ${{ always() && inputs.fuzzer == 'NO_FUZZ' }} @@ -195,6 +197,30 @@ jobs: retention-days: 7 if-no-files-found: ignore + - name: Sanitizer Output + if: ${{ always() && inputs.fuzzer == 'NO_FUZZ' }} + working-directory: ${{ github.workspace }} + run: | + SANITIZER_PROBLEM=0 + if [ -e asan.log ]; then + echo '::group::ASAN' + cat asan.log + echo '::endgroup::' + SANITIZER_PROBLEM=1 + fi + if [ -e ubsan.log ]; then + echo '::group::UBSAN' + cat ubsan.log + echo '::endgroup::' + SANITIZER_PROBLEM=1 + fi + if [ "$SANITIZER_PROBLEM" = 1 ]; then + return 1 + else + echo 'No sanitizer issues found.' + return 0 + fi + - name: Lints if: ${{ inputs.os_name == 'Linux' && inputs.fuzzer == 'NO_FUZZ' }} working-directory: ${{ github.workspace }}