Skip to content

Update ubuntu Docker tag to noble-20250415.1 #279

Update ubuntu Docker tag to noble-20250415.1

Update ubuntu Docker tag to noble-20250415.1 #279

Workflow file for this run

---
name: SonarCloud
on: # yamllint disable-line rule:truthy
push:
branches: ["main"]
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
build:
name: SonarCloud build and run sonar-scanner
runs-on: ubuntu-24.04
env:
# Directory where build-wrapper output will be placed
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory
steps:
- uses: actions/checkout@v4
with:
# Shallow clones should be disabled for a better relevancy of analysis
fetch-depth: 0
- name: Install Tools
run: |
sudo rm /usr/lib/python3.*/EXTERNALLY-MANAGED
sudo apt-get install lcov
pip install gcovr
- name: Check Tools
run: |
make --version
cmake --version
vcpkg --version
lcov --version
gcovr --version
- name: Install dependencies
run: |
make dependencies
- name: Install Build Wrapper
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@master
# yamllint disable rule:line-length
- name: Run build-wrapper
run: |
export VCPKG_ROOT=/usr/local/share/vcpkg
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make build
# yamllint enable rule:line-length
- name: Run tests to generate coverage statistics
run: |
make coverage
- name: Collect coverage into one XML report
run: |
gcovr -e "src/tests/*" --sonarqube > coverage.xml
# yamllint disable rule:line-length
- name: Analyze with SonarQube / SonarCloud
uses: SonarSource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
# Consult https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/scanners/sonarscanner/ for more information and options
args: >
--define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"
--define sonar.coverageReportPaths=coverage.xml
# yamllint enable rule:line-length