Skip to content

chore(deps): update github/codeql-action action to v3.26.7 #220

chore(deps): update github/codeql-action action to v3.26.7

chore(deps): update github/codeql-action action to v3.26.7 #220

Workflow file for this run

name: SonarCloud
on:
push:
branches:
- master
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
build:
name: Build and analyze
runs-on: ubuntu-24.04
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory
CXX: clang++-18
steps:
- name: Check out code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Install dependencies
uses: ./.github/actions/install-dependencies
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@816b1822d71776ee0d32bc012e95024ec52ac1fc # v3.1.0
- name: Install gcovr
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends gcovr
- name: Run build-wrapper
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Coverage
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build
- name: Run tests
run: ctest --test-dir build --output-on-failure
- name: Generate coverage
run: gcovr -f src --exclude-noncode-lines --exclude-throw-branches --exclude-unreachable-branches --sonarqube coverage-sonarqube.xml --lcov coverage-lcov.xml --gcov-executable 'llvm-cov-17 gcov'
- 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 }}" --define sonar.coverageReportPaths=coverage-sonarqube.xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage-lcov.xml