[actions] updated github actions for sonarcloud #223
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: C/C++ CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
environment: dev | |
name: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.8 for gcovr | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: install gcovr 5.0 | |
run: | | |
pip install gcovr==5.0 | |
- name: init | |
run: | | |
./bin/init.sh --init --no-update --no-upgrade --lcov --clangd --setup | |
- name: coverage | |
run: | | |
./bin/coverageall.sh --all | |
- name: collect | |
run: | | |
gcovr --sonarqube > coverage/coverage.xml | |
- name: SonarQube sScan | |
uses: SonarSource/sonarqube-scan-action@v4 | |
env: | |
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} | |
with: | |
args: > | |
--define sonar.coverageReportPaths=coverage/coverage.xml | |
- name: Coveralls GitHub Action | |
uses: coverallsapp/[email protected] |