Skip to content

Run Sonar analysis (k8s) #27

Run Sonar analysis (k8s)

Run Sonar analysis (k8s) #27

Workflow file for this run

name: Run Sonar analysis (k8s)
on:
workflow_dispatch:
inputs:
branch:
required: true
type: string
description: Branch to analyze
jobs:
code_analysis:
runs-on: [k8s]
defaults:
run:
working-directory: cpp
env:
BUILD_WRAPPER_OUT_DIR: ".build_wrapper_out"
SONAR_SERVER_URL: "https://sonarcloud.io"
SONAR_PROJECT_KEY: "uweseimet_scsi2pi"
SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
# Shallow clones should be disabled for a better relevancy of analysis
fetch-depth: 0
- name: Run build-wrapper
run: |
build-wrapper-linux-x86-64 --out-dir $BUILD_WRAPPER_OUT_DIR \
make -j2 coverage DEBUG=1
- name: Generate coverage data
run: gcovr --sonarqube > coverage.xml
- name: Run sonar-scanner
run: |

Check failure on line 43 in .github/workflows/analyze_k8s.yml

View workflow run for this annotation

GitHub Actions / Run Sonar analysis (k8s)

Invalid workflow file

The workflow is not valid. .github/workflows/analyze_k8s.yml (Line: 43, Col: 14): Unexpected symbol: '\'. Located at position 15 within expression: inputs.branch \ --define sonar.target.branch ${{ inputs.branch
sonar-scanner \
--define sonar.host.url=$SONAR_SERVER_URL \
--define sonar.projectKey=$SONAR_PROJECT_KEY \
--define sonar.organization=$SONAR_ORGANIZATION \
--define sonar.cfamily.build-wrapper-output=$BUILD_WRAPPER_OUT_DIR \
--define sonar.coverageReportPaths=coverage.xml \
--define sonar.branch ${{ inputs.branch \
--define sonar.target.branch ${{ inputs.branch }} \
--define sonar.exclusions="obj/**,lib/**,bin/**,generated/**" \
--define sonar.coverage.exclusions="test/**" \
--define sonar.cpd.exclusions="test/**"