Skip to content

support field disconnection for linking components #233

support field disconnection for linking components

support field disconnection for linking components #233

Workflow file for this run

name: SonarCloud analysis
on:
push:
branches:
- '**'
tags:
- '**'
pull_request:
branches:
- main
workflow_dispatch: null
permissions:
pull-requests: read # allows SonarCloud to decorate PRs with analysis results
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up Python for gcovr
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip # caching pip dependencies
- name: install gcovr & pytest
run: |
pip install gcovr pytest
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v3
- name: Configure cmake
run: |
#configure and extract project version
echo "PROJECT_VERSION=$(cmake -B build -DCMAKE_BUILD_TYPE=Debug -DXSMP_ENABLE_CODECOVERAGE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -S ${{github.workspace}} | grep -oP 'xsmp-sdk v\K[^ ]+')" >> $GITHUB_ENV
- name: Build
run: |
cmake --build build --config Debug -j 2
- name: Run tests
run: |
cd build && ctest -C Debug --output-on-failure
- name: Collect coverage into one XML report
run: |
gcovr --sonarqube coverage.xml
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
run: >
sonar-scanner
-Dsonar.projectKey=ThalesGroup_xsmp-sdk
-Dsonar.organization=thalesgroup
-Dsonar.projectVersion=${{env.PROJECT_VERSION}}
-Dsonar.cfamily.compile-commands=build/compile_commands.json
-Dsonar.coverageReportPaths=coverage.xml
-Dsonar.sources=include,src
-Dsonar.tests=src,tests
-Dsonar.sourceEncoding=UTF-8
-Dsonar.c.file.suffixes=.c
-Dsonar.cpp.file.suffixes=.cpp,.h
-Dsonar.exclusions=src/Xsmp/Tests/**,src/python/**
-Dsonar.test.inclusions=src/Xsmp/Tests/**