diff --git a/.github/workflows/test-library.yml b/.github/workflows/test-library.yml index f1b206bd5..1c03c80dc 100644 --- a/.github/workflows/test-library.yml +++ b/.github/workflows/test-library.yml @@ -182,13 +182,19 @@ jobs: env: CXX: clang++-14 CC: clang-14 - run: | # Retrieve warnings generated but not the ones of OpenMM + run: | scan-build-14 --use-cc=clang-14 --use-c++=clang++-14 cmake -P devel-tools/build_test_library.cmake 2>&1 | tee build_analyser.log; \ + grep "CMake Error" build_analyser.log > build_errors.log; \ + if [ -s build_errors.log ] ; then echo "Found compiler errors during build"; cat build_analyser.log; exit 1; fi + + - name: Analyze logs + run: | # Retrieve warnings generated but not the ones of OpenMM awk '/warning/,/warning.*generated|^$/' build_analyser.log | awk '!/openmm.*warning/,/warning.*generated|^$/' | tee warnings_analyser.log; \ if [ -s warnings_analyser.log ] ; then echo "Found compiler warning during build"; cat warnings_analyser.log; exit 1; fi - name: Archive warnings artifacts uses: actions/upload-artifact@v3 + if: failure() with: name: warnings_analyser path: warnings_analyser.log