diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b591bab..48ce8e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,16 +35,16 @@ jobs: variant: sccache - uses: lukka/run-cmake@c2b72aff009141774c5a5fabe74ea46c8c04d9c4 # v10.6 with: - configurePreset: "ContinuousIntegration" - buildPreset: "ContinuousIntegration" - testPreset: "ContinuousIntegration" + configurePreset: "continuous-integration" + buildPreset: "continuous-integration" + testPreset: "continuous-integration" configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=sccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=sccache']" - name: Upload test logs if: ${{ failure() }} uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: name: test-logs - path: build/ContinuousIntegration/Testing/Temporary/ + path: build/continuous-integration/Testing/Temporary/ embedded_build: name: Embedded Build runs-on: ubuntu-latest diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 5bb6b2f..f9a4699 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -18,41 +18,37 @@ jobs: sonar: name: SonarCloud runs-on: ubuntu-latest + container: ghcr.io/philips-software/amp-devcontainer:2.5.0 env: - SONAR_SCANNER_VERSION: 4.7.0.2747 + SONAR_SCANNER_VERSION: 5.0.1.3006 SONAR_SERVER_URL: "https://sonarcloud.io" steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: fetch-depth: 0 # Disable shallow clone to enable blame information persist-credentials: false - - run: sudo apt-get update && sudo apt-get install --no-install-recommends jq ninja-build xsltproc - - uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0 - - uses: BSFishy/pip-action@8f2d471d809dc20b6ada98c91910b6ae6243f318 - with: - packages: gcovr==5.2 - - name: Install Sonar Scanner & Mull + - name: Install Sonar Scanner run: | wget -qN "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip" unzip -qqo "sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip" echo "${PWD}/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> "$GITHUB_PATH" - wget -qN https://github.com/mull-project/mull/releases/download/0.18.0/Mull-12-0.18.0-LLVM-12.0-ubuntu-20.04.deb - sudo dpkg -i Mull-12-0.18.0-LLVM-12.0-ubuntu-20.04.deb - uses: hendrikmuhs/ccache-action@6d1841ec156c39a52b1b23a810da917ab98da1f4 # v1.2.10 with: key: ${{ github.job }} max-size: 2G - name: Build & Collect Coverage run: | - cmake --preset Coverage -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - cmake --build --preset Coverage - GTEST_OUTPUT="xml:${PWD}/testresults/" ctest --preset Coverage + cmake --preset coverage -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + cmake --build --preset coverage + GTEST_OUTPUT="xml:${PWD}/testresults/" ctest --preset coverage gcovr --sonarqube=coverage.xml --exclude-lines-by-pattern '.*assert\(.*\);|.*really_assert\(.*\);|.*std::abort();' --exclude-unreachable-branches --exclude-throw-branches -j 2 --exclude=.*/generated/.* --exclude=.*/examples/.* --exclude=.*/tracing/.* --exclude=.*/test/.* - name: Convert Results run: | { echo ''; xsltproc .github/formatters/gtest-to-generic-execution.xslt testresults/*.xml; echo ''; } | tee execution.xml > /dev/null - cp build/Coverage/compile_commands.json compile_commands.json + cp build/coverage/compile_commands.json compile_commands.json - name: Run Analysis + # skip the analysis step for dependabot PRs since dependabot does not have access to secrets + if: ${{ github.actor != 'dependabot[bot]' }} env: # to get access to secrets.SONAR_TOKEN, provide GITHUB_TOKEN GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -75,7 +71,7 @@ jobs: with: languages: cpp - run: | - cmake --preset ContinuousIntegration -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - cmake --build --preset ContinuousIntegration + cmake --preset continuous-integration -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + cmake --build --preset continuous-integration - uses: github/codeql-action/analyze@ddccb873888234080b77e9bc2d4764d5ccaaccf9 # v2.21.9 diff --git a/CMakePresets.json b/CMakePresets.json index 8f9028f..e4726c8 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -10,7 +10,7 @@ } }, { - "name": "ContinuousIntegration", + "name": "continuous-integration", "displayName": "Configuration for Continuous Integration", "inherits": "defaults", "cacheVariables": { @@ -22,9 +22,9 @@ } }, { - "name": "Coverage", + "name": "coverage", "displayName": "Configuration for Code Coverage", - "inherits": "ContinuousIntegration", + "inherits": "continuous-integration", "cacheVariables": { "EMIL_ENABLE_COVERAGE": "On" }, @@ -93,14 +93,14 @@ ], "buildPresets": [ { - "name": "ContinuousIntegration", + "name": "continuous-integration", "configuration": "Debug", - "configurePreset": "ContinuousIntegration" + "configurePreset": "continuous-integration" }, { - "name": "Coverage", + "name": "coverage", "configuration": "Debug", - "configurePreset": "Coverage" + "configurePreset": "coverage" }, { "name": "host-RelWithDebInfo", @@ -136,14 +136,14 @@ } }, { - "name": "ContinuousIntegration", - "configurePreset": "ContinuousIntegration", + "name": "continuous-integration", + "configurePreset": "continuous-integration", "configuration": "Debug", "inherits": "defaults" }, { - "name": "Coverage", - "configurePreset": "Coverage", + "name": "coverage", + "configurePreset": "coverage", "configuration": "Debug", "inherits": "defaults" }