Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/oxsecurity/megalin…
Browse files Browse the repository at this point in the history
…ter-7.5.0
  • Loading branch information
EkelmansPh authored Nov 2, 2023
2 parents ddb79c6 + 9182814 commit 71e6be7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 30 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 11 additions & 15 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<testExecutions version="1">'; xsltproc .github/formatters/gtest-to-generic-execution.xslt testresults/*.xml; echo '</testExecutions>'; } | 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 }}
Expand All @@ -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

22 changes: 11 additions & 11 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
},
{
"name": "ContinuousIntegration",
"name": "continuous-integration",
"displayName": "Configuration for Continuous Integration",
"inherits": "defaults",
"cacheVariables": {
Expand All @@ -22,9 +22,9 @@
}
},
{
"name": "Coverage",
"name": "coverage",
"displayName": "Configuration for Code Coverage",
"inherits": "ContinuousIntegration",
"inherits": "continuous-integration",
"cacheVariables": {
"EMIL_ENABLE_COVERAGE": "On"
},
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
Expand Down

0 comments on commit 71e6be7

Please sign in to comment.