ci: use sonarsource/sonarcloud-github-c-cpp
This commit is contained in:
parent
bb6df4990a
commit
44bd69fdc8
2 changed files with 5 additions and 16 deletions
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
|
|
@ -37,11 +37,12 @@ jobs:
|
||||||
|
|
||||||
- name: Check PR comment for flags
|
- name: Check PR comment for flags
|
||||||
id: check
|
id: check
|
||||||
|
env:
|
||||||
|
PR_BODY: ${{ github.event.pull_request.body }}
|
||||||
run: |
|
run: |
|
||||||
pr_body="${{ github.event.pull_request.body }}"
|
|
||||||
no_sonar="{no-sonar}"
|
no_sonar="{no-sonar}"
|
||||||
|
|
||||||
if echo $pr_body | grep -q "$no_sonar"; then
|
if echo $PR_BODY | grep -q "$no_sonar"; then
|
||||||
echo "Flag $no_sonar found in PR body."
|
echo "Flag $no_sonar found in PR body."
|
||||||
echo "no-sonar=true" >> $GITHUB_OUTPUT
|
echo "no-sonar=true" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
|
|
|
||||||
16
.github/workflows/sonarcloud-analysis.yml
vendored
16
.github/workflows/sonarcloud-analysis.yml
vendored
|
|
@ -49,26 +49,14 @@ jobs:
|
||||||
# Prevent apt prompting for input.
|
# Prevent apt prompting for input.
|
||||||
DEBIAN_FRONTEND: noninteractive
|
DEBIAN_FRONTEND: noninteractive
|
||||||
|
|
||||||
- name: Install SonarScanner
|
- name: Install sonar-scanner and build-wrapper
|
||||||
run: |
|
uses: sonarsource/sonarcloud-github-c-cpp@v3
|
||||||
export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux-x64
|
|
||||||
curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip \
|
|
||||||
$SONAR_SCANNER_URL_BASE/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux-x64.zip
|
|
||||||
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
|
|
||||||
|
|
||||||
- name: Install build-wrapper
|
|
||||||
run: |
|
|
||||||
file="build-wrapper-linux-x86.zip"
|
|
||||||
url="https://sonarcloud.io/static/cpp/$file"
|
|
||||||
curl --create-dirs -sSLo $HOME/.sonar/$file $url
|
|
||||||
unzip -o $HOME/.sonar/$file -d $HOME/.sonar/
|
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
run: cmake -B build --preset=linux-debug -DENABLE_COVERAGE=ON
|
run: cmake -B build --preset=linux-debug -DENABLE_COVERAGE=ON
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
export PATH=$HOME/.sonar/build-wrapper-linux-x86:$PATH
|
|
||||||
build-wrapper-linux-x86-64 --out-dir bw-output cmake --build build -j${CPU_CORE_COUNT}
|
build-wrapper-linux-x86-64 --out-dir bw-output cmake --build build -j${CPU_CORE_COUNT}
|
||||||
|
|
||||||
- name: Unit tests coverage
|
- name: Unit tests coverage
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue