ci: use sonarqube-scan-action #399
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: Build & Test | |
| on: | |
| push: | |
| branches: [main] | |
| tags: | |
| - v** | |
| merge_group: | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.ref }}-${{ github.workflow }} | |
| cancel-in-progress: true | |
| env: | |
| GTEST_COLOR: 1 | |
| jobs: | |
| build-windows: | |
| name: Windows Host Build | |
| runs-on: [ubuntu-latest] | |
| container: ghcr.io/philips-software/amp-devcontainer-cpp:5.6.2@sha256:a0804f7454d52564f07317f7e09a012261b6d9553dbe8854fcf265dce571cf86 # v5.6.2 | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
| id: cache-winsdk | |
| with: | |
| path: /winsdk | |
| key: cache-winsdk | |
| - if: ${{ steps.cache-winsdk.outputs.cache-hit != 'true' }} | |
| run: ./get-winsdk.sh | |
| - uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17 | |
| with: | |
| key: ${{ github.job }} | |
| max-size: 2G | |
| - uses: lukka/run-cmake@af1be47fd7c933593f687731bc6fdbee024d3ff4 # v10.8 | |
| with: | |
| configurePreset: "Windows" | |
| buildPreset: "Windows-Release" | |
| configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=ccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache']" | |
| build-linux: | |
| name: Linux Host Build | |
| runs-on: [ubuntu-24.04] | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17 | |
| with: | |
| key: ${{ github.job }} | |
| max-size: 2G | |
| - uses: seanmiddleditch/gha-setup-ninja@96bed6edff20d1dd61ecff9b75cc519d516e6401 # v5 | |
| - uses: lukka/run-cmake@af1be47fd7c933593f687731bc6fdbee024d3ff4 # v10.8 | |
| with: | |
| configurePreset: "Host" | |
| buildPreset: "Host-Release" | |
| testPreset: "Host-Release" | |
| configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=ccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache']" | |
| - name: Upload test logs | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 | |
| with: | |
| name: test-logs | |
| path: build/Host/Testing/Temporary/ | |
| build-linux-devcontainer: | |
| name: Linux Host Build in Devcontainer | |
| runs-on: [ubuntu-latest] | |
| container: ghcr.io/philips-software/amp-devcontainer-cpp:5.6.2@sha256:a0804f7454d52564f07317f7e09a012261b6d9553dbe8854fcf265dce571cf86 # v5.6.2 | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17 | |
| with: | |
| key: ${{ github.job }} | |
| max-size: 2G | |
| - uses: lukka/run-cmake@af1be47fd7c933593f687731bc6fdbee024d3ff4 # v10.8 | |
| with: | |
| configurePreset: "Host" | |
| buildPreset: "Host-Release" | |
| testPreset: "Host-Release" | |
| configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=ccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache']" | |
| - name: Upload test logs | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 | |
| with: | |
| name: test-logs | |
| path: build/Host/Testing/Temporary/ | |
| test-linux: | |
| name: Linux Host Test | |
| runs-on: [ubuntu-latest] | |
| permissions: | |
| contents: read | |
| issues: read | |
| checks: write | |
| pull-requests: write | |
| container: ghcr.io/philips-software/amp-devcontainer-cpp:5.6.2@sha256:a0804f7454d52564f07317f7e09a012261b6d9553dbe8854fcf265dce571cf86 # v5.6.2 | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17 | |
| with: | |
| key: ${{ github.job }} | |
| max-size: 2G | |
| - uses: lukka/run-cmake@af1be47fd7c933593f687731bc6fdbee024d3ff4 # v10.8 | |
| with: | |
| configurePreset: "Host" | |
| buildPreset: "Host-Debug" | |
| configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=ccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache']" | |
| - run: | | |
| bats --formatter junit cucumber_cpp/acceptance_test/test.bats | tee test-report.xml | |
| - uses: EnricoMi/publish-unit-test-result-action@170bf24d20d201b842d7a52403b73ed297e6645b # v2.18.0 | |
| if: always() | |
| with: | |
| files: test-report.xml | |
| host_build_test: | |
| name: Host Build & Test | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: false | |
| - uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17 | |
| with: | |
| key: ${{ github.job }}-${{ matrix.os }} | |
| max-size: 2G | |
| variant: sccache | |
| - uses: lukka/run-cmake@af1be47fd7c933593f687731bc6fdbee024d3ff4 # v10.8 | |
| with: | |
| configurePreset: "host-single-Debug" | |
| buildPreset: "host-single-Debug" | |
| testPreset: "host-single-Debug" | |
| configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=sccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=sccache']" | |
| - name: Upload test logs | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 | |
| with: | |
| name: test-logs | |
| path: build/host-single-Dbebug/Testing/Temporary/ |