Skip to content

ci: use macos sonarcloud build wrapper on macos #117

ci: use macos sonarcloud build wrapper on macos

ci: use macos sonarcloud build wrapper on macos #117

Workflow file for this run

name: Tests
on:
- push
jobs:
build-test:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- name: Install gcovr
run: pip3 install gcovr
- name: Setup sonar cloud
uses: SonarSource/[email protected]
- name: Build tests
run: cmake -B build -S .
- name: Build tests (linux)
if: matrix.platform == 'ubuntu-latest'
run: build-wrapper-linux-x86-64 --out-dir bw-output cmake --build build
- name: Build tests (macos)
if: matrix.platform == 'macos-latest'
run: build-wrapper-macosx-x86 --out-dir bw-output cmake --build build
- name: Run tests and coverage
run: ./build/tests/tests
- name: Generate coverage report
run: gcovr --sonarqube -o coverage.xml build
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner \
--define sonar.cfamily.build-wrapper-output="bw-output" \
--define sonar.coverageReportPaths=coverage.xml