Skip to content

Merge pull request #166 from vil02/renovate/markusjx-install-boost-2.x #360

Merge pull request #166 from vil02/renovate/markusjx-install-boost-2.x

Merge pull request #166 from vil02/renovate/markusjx-install-boost-2.x #360

---
name: third_party_checks
'on':
workflow_dispatch:
push:
branches:
- master
pull_request:
jobs:
third_party_checks:
name: Build (sonarCloud)
runs-on: ubuntu-24.04
env:
SONAR_SERVER_URL: "https://sonarcloud.io"
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Validate codecov.yml file
run: |
./validate_codecov_yml.sh
- name: Install sonar-scanner and build-wrapper
uses: sonarsource/sonarcloud-github-c-cpp@v3
- name: Install boost
run: |
sudo apt-get update
sudo apt-get install libboost-all-dev
- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Create virtual environment
run: |
python3 -m venv ./venv
source ./venv/bin/activate
echo "PATH=${PATH}" >> "${GITHUB_ENV}"
- name: Install gcovr
run: |
python3 -m pip install --upgrade pip
python3 -m pip install gcovr
- name: Run build-wrapper
run: |
mkdir build
cmake -S . -B build
build-wrapper-linux-x86-64 \
--out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} \
cmake --build build/ --config Debug
- name: Generate coverage data xml report
run: |
cd scripts
./generate_raw_coverage_data_gxx.sh
./run_gcovr_sonarqube.sh
./run_gcovr_cobertura.sh
- name: Run sonar-scanner
if: "! github.event.pull_request.head.repo.fork "
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# yamllint disable rule:line-length
run: >
sonar-scanner
--define sonar.host.url="${{ env.SONAR_SERVER_URL }}"
--define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"
# yamllint enable rule:line-length
- name: Copy the coverage report to the root
run: cp ./coverage_reports/cobertura_coverage_report.xml .
- name: Upload coverage report to Codecov
if: "! github.event.pull_request.head.repo.fork "
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: cobertura_coverage_report.xml
- name: Upload coverage report to Codecov (tokenless)
if: >-
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name != github.repository
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
files: cobertura_coverage_report.xml
- name: Upload coverage report to Codacy
if: "! github.event.pull_request.head.repo.fork "
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: cobertura_coverage_report.xml
language: CPP
...