Skip to content

sonarscan

sonarscan #121

Workflow file for this run

name: sonarscan
on:
schedule:
- cron: '00 23 * * *'
workflow_dispatch:
jobs:
sonarscan:

Check failure on line 7 in .github/workflows/sonarscan.yml

View workflow run for this annotation

GitHub Actions / sonarscan

Invalid workflow file

The workflow is not valid. .github/workflows/sonarscan.yml (Line: 7, Col: 3): The workflow must contain at least one job with no dependencies.
needs: build
runs-on: ubuntu-22.04
env:
BUILD_TYPE: Debug
SONAR_SCANNER_VERSION: 4.6.1.2450 # Find the latest version in the "Linux" link on this page:
# https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/
SONAR_HOST_URL: "https://sonarcloud.io"
steps:
- name: Cache SonarQube packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Download and set up sonar-scanner
env:
SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip
run: |
mkdir -p $HOME/.sonar
curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }}
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
# Set the property "sonar.cfamily.compile-commands" to the compilation database file
sonar-scanner --define sonar.host.url="${{ env.SONAR_HOST_URL }}" --define sonar.cfamily.compile-commands=${{env.BUILD_TYPE}}/compile_commands.json