build(deps): bump github/codeql-action from 8a06050a8c0348fb4738f28e0cfbb6727cf054ce to 71d0a56d4479a74c3dd8cf7a47d5661f11752db8 #381
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Static Analysis | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.ref }}-${{ github.workflow }} | |
| cancel-in-progress: true | |
| jobs: | |
| sonar: | |
| name: SonarCloud | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/philips-software/amp-devcontainer-cpp:5.6.2@sha256:a0804f7454d52564f07317f7e09a012261b6d9553dbe8854fcf265dce571cf86 # v5.6.2 | |
| env: | |
| SONAR_SERVER_URL: "https://sonarcloud.io" | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 # Disable shallow clone to enable blame information | |
| persist-credentials: false | |
| - uses: hendrikmuhs/ccache-action@bfa03e1de4d7f7c3e80ad9109feedd05c4f5a716 # v1.2.19 | |
| with: | |
| key: ${{ github.job }} | |
| max-size: 2G | |
| - name: Build for coverage | |
| uses: lukka/run-cmake@af1be47fd7c933593f687731bc6fdbee024d3ff4 # v10.8 | |
| with: | |
| configurePreset: "Coverage" | |
| buildPreset: "Coverage" | |
| testPreset: "Coverage" | |
| configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=ccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache']" | |
| env: | |
| GTEST_OUTPUT: "xml:${{ github.workspace }}/testresults/" | |
| - name: Run acceptance tests | |
| run: | | |
| bats --formatter junit cucumber_cpp/acceptance_test/coverage.bats | tee test-report.xml | |
| - name: Collect coverage | |
| run: | | |
| gcovr --sonarqube=coverage.xml --exclude-lines-by-pattern '.*assert\(.*\);|.*really_assert\(.*\);|.*std::abort();' --exclude-unreachable-branches --exclude-throw-branches -j "$(nproc)" --exclude=.*/example/.* --exclude=.*/external/.* --exclude=.*/test/.* | |
| - uses: philips-software/sonarqube-issue-conversion@9e9958764ba5fd1d302b039779dc902bedfa4d01 # v1.2.0 | |
| with: | |
| input: ${{ github.workspace }}/testresults/*.xml | |
| output: execution.xml | |
| transformation: gtest-to-generic-execution | |
| - name: Convert results | |
| run: | | |
| cp .build/Coverage/compile_commands.json compile_commands.json | |
| - uses: sonarsource/sonarqube-scan-action@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602 # v6.0.0 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| codeql: | |
| name: CodeQL | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/philips-software/amp-devcontainer-cpp:5.6.2@sha256:a0804f7454d52564f07317f7e09a012261b6d9553dbe8854fcf265dce571cf86 # v5.6.2 | |
| permissions: | |
| security-events: write | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: hendrikmuhs/ccache-action@bfa03e1de4d7f7c3e80ad9109feedd05c4f5a716 # v1.2.19 | |
| with: | |
| key: ${{ github.job }} | |
| - uses: github/codeql-action/init@71d0a56d4479a74c3dd8cf7a47d5661f11752db8 # v4.31.2 | |
| with: | |
| languages: cpp | |
| - uses: lukka/run-cmake@af1be47fd7c933593f687731bc6fdbee024d3ff4 # v10.8 | |
| with: | |
| configurePreset: "Host" | |
| buildPreset: "Host-Debug" | |
| configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=ccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache']" | |
| - uses: github/codeql-action/analyze@71d0a56d4479a74c3dd8cf7a47d5661f11752db8 # v4.31.2 |