33env :
44 HDF5_VERSION : 1.12.2
55 HDF5_CACHE_VERSION : v3
6+ CDASH_SUBMIT : ${{ (github.event_name == 'push' && github.ref_name == 'release') || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'cdash')) }}
67
78on :
89 push :
@@ -328,7 +329,17 @@ jobs:
328329 run : cmake --build build --parallel --config Release
329330
330331 - name : Test
331- run : ctest --test-dir build -C Release --output-on-failure
332+ shell : bash
333+ run : |
334+ set -euxo pipefail
335+ if [ "$CDASH_SUBMIT" = "true" ]; then
336+ ctest -D Experimental --test-dir build -C Release --output-on-failure
337+ else
338+ ctest --test-dir build -C Release --output-on-failure
339+ fi
340+ env :
341+ CTEST_SITE : " github-actions"
342+ CTEST_BUILD_NAME : " ${{ matrix.os }}-${{ matrix.compiler }}"
332343
333344 - name : Record Badge Status
334345 if : always()
@@ -402,7 +413,14 @@ jobs:
402413 shell : bash
403414 env :
404415 ASAN_OPTIONS : " detect_leaks=1:halt_on_error=1:abort_on_error=1:strict_string_checks=1"
405- run : ctest --test-dir build --output-on-failure
416+ CTEST_SITE : " github-actions"
417+ CTEST_BUILD_NAME : " asan-ubuntu-24.04-clang-20"
418+ run : |
419+ if [ "$CDASH_SUBMIT" = "true" ]; then
420+ ctest -D Experimental --test-dir build --output-on-failure
421+ else
422+ ctest --test-dir build --output-on-failure
423+ fi
406424
407425 - name : Record Badge Status
408426 if : always()
@@ -475,7 +493,14 @@ jobs:
475493 shell : bash
476494 env :
477495 UBSAN_OPTIONS : " print_stacktrace=1:halt_on_error=1"
478- run : ctest --test-dir build --output-on-failure
496+ CTEST_SITE : " github-actions"
497+ CTEST_BUILD_NAME : " ubsan-ubuntu-24.04-clang-20"
498+ run : |
499+ if [ "$CDASH_SUBMIT" = "true" ]; then
500+ ctest -D Experimental --test-dir build --output-on-failure
501+ else
502+ ctest --test-dir build --output-on-failure
503+ fi
479504
480505 - name : Record Badge Status
481506 if : always()
@@ -499,10 +524,93 @@ jobs:
499524 name : status-ubsan
500525 path : badge-status/status-ubsan.json
501526
527+ tsan :
528+ name : tsan / ubuntu-24.04 / clang-20
529+ runs-on : ubuntu-24.04
530+ timeout-minutes : 45
531+
532+ concurrency :
533+ group : tsan-${{ github.ref }}
534+ cancel-in-progress : true
535+
536+ steps :
537+ - name : Checkout
538+ uses : actions/checkout@v6
539+ with :
540+ fetch-depth : 0
541+
542+ - name : Install dependencies
543+ shell : bash
544+ run : |
545+ set -euxo pipefail
546+ sudo apt-get update
547+ sudo apt-get install -y cmake ninja-build wget gnupg lsb-release software-properties-common libhdf5-dev
548+ wget https://apt.llvm.org/llvm.sh
549+ chmod +x llvm.sh
550+ sudo ./llvm.sh 20 all
551+ echo "CC=$(command -v clang-20)" >> "$GITHUB_ENV"
552+ echo "CXX=$(command -v clang++-20)" >> "$GITHUB_ENV"
553+
554+ - name : Configure
555+ shell : bash
556+ run : |
557+ set -euxo pipefail
558+ cmake -S . -B build -G Ninja \
559+ -DCMAKE_C_COMPILER="$CC" \
560+ -DCMAKE_CXX_COMPILER="$CXX" \
561+ -DCMAKE_CXX_STANDARD=17 \
562+ -DCMAKE_BUILD_TYPE=Debug \
563+ -DCMAKE_C_FLAGS="-fsanitize=thread -fno-omit-frame-pointer -O1 -g" \
564+ -DCMAKE_CXX_FLAGS="-fsanitize=thread -fno-omit-frame-pointer -O1 -g" \
565+ -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=thread" \
566+ -DH5CPP_BUILD_TESTS=ON
567+
568+ - name : Build
569+ shell : bash
570+ run : cmake --build build --parallel
571+
572+ - name : Test
573+ shell : bash
574+ env :
575+ # halt_on_error=1: TSAN exits on the first data race so CI fails loud.
576+ # second_deadlock_stack=1: print full stack of the lock that completed
577+ # the cycle (default prints only one stack for the offending pair).
578+ TSAN_OPTIONS : " halt_on_error=1:second_deadlock_stack=1"
579+ CTEST_SITE : " github-actions"
580+ CTEST_BUILD_NAME : " tsan-ubuntu-24.04-clang-20"
581+ run : |
582+ if [ "$CDASH_SUBMIT" = "true" ]; then
583+ ctest -D Experimental --test-dir build --output-on-failure
584+ else
585+ ctest --test-dir build --output-on-failure
586+ fi
587+
588+ - name : Record Badge Status
589+ if : always()
590+ shell : bash
591+ run : |
592+ set -euxo pipefail
593+ mkdir -p badge-status
594+ cat <<EOF > badge-status/status-tsan.json
595+ {
596+ "os": "ubuntu-24.04",
597+ "compiler": "clang-20",
598+ "label": "TSan",
599+ "status": "${{ job.status }}"
600+ }
601+ EOF
602+
603+ - name : Upload Status Artifact
604+ if : always()
605+ uses : actions/upload-artifact@v7
606+ with :
607+ name : status-tsan
608+ path : badge-status/status-tsan.json
609+
502610 badge :
503611 name : Generate SVG Badges
504612 if : always()
505- needs : [build, asan, ubsan]
613+ needs : [build, asan, ubsan, tsan ]
506614 runs-on : ubuntu-24.04
507615
508616 steps :
@@ -648,8 +756,8 @@ jobs:
648756 -DCMAKE_CXX_STANDARD=20 \
649757 -DCMAKE_C_COMPILER=gcc-14 \
650758 -DCMAKE_CXX_COMPILER=g++-14 \
651- -DCMAKE_C_FLAGS="--coverage -O0 -g" \
652- -DCMAKE_CXX_FLAGS="--coverage -O0 -g" \
759+ -DCMAKE_C_FLAGS="--coverage -fprofile-update=atomic - O0 -g" \
760+ -DCMAKE_CXX_FLAGS="--coverage -fprofile-update=atomic - O0 -g" \
653761 -DH5CPP_BUILD_TESTS=ON \
654762 -DH5CPP_BUILD_EXAMPLES=ON
655763
@@ -661,9 +769,16 @@ jobs:
661769
662770 - name : Test
663771 shell : bash
772+ env :
773+ CTEST_SITE : " github-actions"
774+ CTEST_BUILD_NAME : " coverage-ubuntu-24.04-gcc-14"
664775 run : |
665776 set -euxo pipefail
666- ctest --test-dir build --output-on-failure --parallel
777+ if [ "$CDASH_SUBMIT" = "true" ]; then
778+ ctest -D Experimental --test-dir build --output-on-failure --parallel
779+ else
780+ ctest --test-dir build --output-on-failure --parallel
781+ fi
667782
668783 - name : Capture coverage
669784 shell : bash
0 commit comments