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 directly from the original vendor instead of a third
party.
  • Loading branch information
mlasch committed Jan 30, 2024
1 parent 4a49d40 commit 48af173
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 61 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/sonarcloud-scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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 cmake gcovr libcunit1-dev ninja-build unzip wget
- 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 48af173

Please sign in to comment.