Skip to content

Commit

Permalink
ci: Fix SonarCloud Scan with outdated Java version
Browse files Browse the repository at this point in the history
SonarCloud Scan does no longer support Java 11. Use
`sonarsource/sonarcloud-github-c-cpp` action to install sonarcloud and
the build-wrapper.
  • Loading branch information
mlasch committed Jan 29, 2024
1 parent b560c49 commit d2812ae
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 61 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/sonarcloud-scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: SonarCloud Scan

on: [push]

jobs:
sonarcloud:
runs-on: ubuntu-22.04

steps:
- name: Checkout code including full history and submodules
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0

- name: Install dependencies from APT repository
run: |
sudo apt-get update
sudo apt-get install gcovr libcunit1-dev wget unzip
- name: Install CMake
uses: lukka/get-cmake@latest

- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master

- name: Install sonar-scanner and build-wrapper
uses: sonarsource/sonarcloud-github-c-cpp@v2

- name: Collect test coverage data
run: |
tools/ci/run_ci.sh \
--run-build \
--run-tests \
--sonarqube build-wrapper-linux-x86-64
- name: Run SonarCloud Scan
run: |
sonar-scanner \
-Dsonar.branch.name="${GITHUB_REF_NAME}" \
-Dsonar.cfamily.build-wrapper-output=build-wakaama/sonar-cloud-build-wrapper-output \
-Dsonar.cfamily.cache.enabled=false \
-Dsonar.cfamily.gcov.reportsPath=build-wakaama \
-Dsonar.cfamily.threads=2 \
-Dsonar.exclusions="build-wakaama-*/**, .git/**" \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=${{ secrets.SONAR_TOKEN }} \
-Dsonar.organization=${{ github.repository_owner }} \
-Dsonar.projectKey="$(echo ${{ github.repository }} | tr / _)" \
-Dsonar.sourceEncoding=UTF-8 \
-Dsonar.sources=.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61 changes: 0 additions & 61 deletions .github/workflows/sonarqube.yaml

This file was deleted.

0 comments on commit d2812ae

Please sign in to comment.