54 lines
1.4 KiB
Plaintext
Vendored
54 lines
1.4 KiB
Plaintext
Vendored
name: Sonar
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- "**/workflows/sonar.yml"
|
|
- "**/Source/**"
|
|
- "**/Tests/**"
|
|
- "**/ThirdParty/**"
|
|
- "**/CMakeLists.txt"
|
|
- "**/.gitmodules"
|
|
- "**/sonar-project.properties"
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
BUILD_TYPE: Release
|
|
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory
|
|
|
|
jobs:
|
|
build:
|
|
name: Build and Analyze
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: true
|
|
|
|
- name: Install sonar-scanner and build-wrapper
|
|
uses: SonarSource/sonarcloud-github-c-cpp@v2
|
|
|
|
- name: Create Build Environment
|
|
run: cmake -E make_directory ${{runner.workspace}}/build
|
|
|
|
- name: Configure
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -G Ninja
|
|
|
|
- name: Run build-wrapper
|
|
run: |
|
|
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build ${{runner.workspace}}/build --config $BUILD_TYPE
|
|
|
|
- name: Run sonar-scanner
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
run: |
|
|
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
|