3333 uses : SonarSource/sonarcloud-github-c-cpp@v3
3434
3535 - name : Install CMake
36- uses : lukka/get-cmake@latest
36+ uses : lukka/get-cmake@v3.30.5
3737 with :
38- cmakeVersion : 3.27.1
38+ cmakeVersion : 3.30.5
3939 ninjaVersion : 1.11.1
4040
4141 - name : Setup CCache
@@ -45,14 +45,16 @@ jobs:
4545 max-size : 100M
4646
4747 - name : Configure CMake
48+ env :
49+ CXXFLAGS : -DNUCLEAR_TEST_TIME_UNIT_DEN=10
4850 run : |
4951 cmake -E make_directory build
5052 cmake -S . -B build \
5153 -GNinja \
5254 -DCMAKE_C_COMPILER_LAUNCHER=ccache \
5355 -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
54- -DBUILD_TESTS=ON \
5556 -DCMAKE_BUILD_TYPE=Debug \
57+ -DBUILD_TESTS=ON \
5658 -DCI_BUILD=ON \
5759 -DENABLE_COVERAGE=ON \
5860 -DENABLE_CLANG_TIDY=OFF
@@ -63,12 +65,28 @@ jobs:
6365
6466 - name : Run tests to generate coverage statistics
6567 timeout-minutes : 10
66- working-directory : build/tests
67- run : ctest --output-on-failure
68+ working-directory : build
69+ run : ninja run_all_tests -j1 -k 0
70+
71+ - name : Test Summary
72+ if : ${{ !cancelled() }}
73+ uses : test-summary/action@v2
74+ with :
75+ paths : " build/reports/tests/*.junit.xml"
6876
6977 - name : Collect coverage into one XML report
7078 if : ${{ !cancelled() }}
71- run : gcovr --gcov-ignore-parse-errors=negative_hits.warn_once_per_file --exclude-unreachable-branches --exclude-noncode-lines --sonarqube > coverage.xml
79+ run : |
80+ gcovr \
81+ --root . \
82+ --object-directory build \
83+ --force-color \
84+ --no-markers \
85+ --decisions \
86+ --calls \
87+ --exclude-noncode-lines \
88+ --gcov-ignore-parse-errors negative_hits.warn \
89+ --sonarqube "coverage.xml"
7290
7391 - name : Upload coverage report
7492 if : ${{ !cancelled() }}
@@ -86,6 +104,10 @@ jobs:
86104 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
87105 run : |
88106 sonar-scanner \
107+ --define sonar.projectKey=Fastcode_NUClear \
108+ --define sonar.organization=fastcode \
109+ --define sonar.sources=src \
110+ --define sonar.tests=tests \
89111 --define sonar.cfamily.compile-commands=build/compile_commands.json \
90112 --define sonar.coverageReportPaths=coverage.xml
91113
0 commit comments