@@ -22,15 +22,15 @@ jobs:
2222 env :
2323 BUILD_WRAPPER_OUT_DIR : build_wrapper_output_directory # Directory where build-wrapper output will be placed
2424 steps :
25- - uses : actions/checkout@v3
25+ - uses : actions/checkout@v4
2626 with :
2727 fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
2828
2929 - name : Install gcovr
30- run : pip install gcovr==6.0
30+ run : pip install gcovr==7.2
3131
3232 - name : Install sonar-scanner and build-wrapper
33- uses : SonarSource/sonarcloud-github-c-cpp@v2
33+ uses : SonarSource/sonarcloud-github-c-cpp@v3
3434
3535 - name : Install CMake
3636 uses : lukka/get-cmake@latest
@@ -57,24 +57,34 @@ jobs:
5757 -DCI_BUILD=ON \
5858 -DENABLE_CLANG_TIDY=OFF
5959
60- - name : Build with Sonar Wrapper
60+ - name : Build the code in debug mode
6161 timeout-minutes : 30
62- run : build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Debug
62+ run : cmake --build build/ --config Debug
6363
6464 - name : Run tests to generate coverage statistics
6565 timeout-minutes : 10
66- run : |
67- build/tests/test_nuclear
68- for f in build/tests/individual/*; do echo "Testing $f"; ./$f; done
66+ working-directory : build/tests
67+ run : ctest --output-on-failure
6968
7069 - name : Collect coverage into one XML report
71- run : gcovr --exclude-unreachable-branches --exclude-noncode-lines --sonarqube > coverage.xml
70+ if : always()
71+ run : gcovr --gcov-ignore-parse-errors=negative_hits.warn_once_per_file --exclude-unreachable-branches --exclude-noncode-lines --sonarqube > coverage.xml
7272
7373 - name : Run sonar-scanner
74+ if : always()
7475 env :
7576 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7677 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
7778 run : |
7879 sonar-scanner \
79- --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" \
80+ --define sonar.cfamily.compile-commands=build/compile_commands.json \
8081 --define sonar.coverageReportPaths=coverage.xml
82+
83+ - name : Upload Traces
84+ if : always()
85+ uses : actions/upload-artifact@v4
86+ with :
87+ name : traces-sonar
88+ path : build/tests/**/*.trace
89+ retention-days : 1 # This sets the artifact TTL to 1 day (minimum is 1 day)
90+ overwrite : true
0 commit comments