From 6494b4078ca3ba732e6ee593c536e390bba0a35f Mon Sep 17 00:00:00 2001 From: tzijnge Date: Sat, 2 Nov 2024 20:45:34 +0100 Subject: [PATCH] #4 Add code coverage * Upload to SonarCloud after code coverage --- .github/workflows/cmake.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 2058859..11c4284 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -53,13 +53,6 @@ jobs: run: | build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build ${{github.workspace}}/cmake_build --config ${{env.BUILD_TYPE}} - - name: Run sonar-scanner - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: | - sonar-scanner --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json" - - name: C++ tests working-directory: ${{github.workspace}}/cmake_build run: ctest -C ${{env.BUILD_TYPE}} --output-junit ../testresults/cpptestresults.xml @@ -77,3 +70,10 @@ jobs: uses: EnricoMi/publish-unit-test-result-action/linux@v2 with: junit_files: "testresults/*.xml" + + - name: Run sonar-scanner + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: | + sonar-scanner --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"