Skip to content

Commit

Permalink
CI: Move sanitizer output into a separate CI step
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AtkinsSJ committed Nov 22, 2024
1 parent 75b7a3e commit 4d48e26
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/lagom-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand All @@ -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 }}
Expand Down

0 comments on commit 4d48e26

Please sign in to comment.