Workflow file for this run
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: SonarCloud C/C++ CI | |
on: | |
push: | |
branches: [ "master", '*-ci' ] | |
pull_request: | |
branches: [ "master" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
name: sonar_cloud | |
runs-on: ubuntu-latest | |
env: | |
BUILD_WRAPPER_OUT_DIR: build_wrapper | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # shallow clones should be disabled for a better relevancy of analysis | |
submodules: recursive | |
- name: Install sonar-scanner and build-wrapper | |
uses: SonarSource/sonarcloud-github-c-cpp@v2 | |
- name: Set up Java 8 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 8 | |
- name: Install dependencies | |
run: sudo apt-get install cmake doxygen graphviz | |
- name: Run build-wrapper | |
run: | | |
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} \ | |
scripts/build.sh cpp zserio cpp_rt-linux64-gcc && scripts/release.sh | |
env: | |
CMAKE_EXTRA_ARGS: "-DCMAKE_BUILD_TYPE=Release" | |
CMAKE_BUILD_OPTIONS: "-j4" | |
- name: Run sonar-scanner | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Put the name of your token here | |
run: | | |
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" |