37 lines
897 B
YAML
37 lines
897 B
YAML
name: SonarQube Analysis
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
sonar:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Docker CLI
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y docker.io
|
|
- name: Debug workspace
|
|
run: |
|
|
pwd
|
|
ls -la
|
|
|
|
- name: Run SonarScanner
|
|
run: |
|
|
docker run --rm \
|
|
--network dev-platform_default \
|
|
-e SONAR_HOST_URL="${{ vars.SONAR_HOST_URL }}" \
|
|
-e SONAR_TOKEN="${{ secrets.SONAR_TOKEN }}" \
|
|
-v "$PWD:/usr/src" \
|
|
sonarsource/sonar-scanner-cli \
|
|
-Dsonar.projectKey="${{ vars.SONAR_PROJECT_KEY }}" \
|
|
-Dsonar.projectName="${{ vars.SONAR_PROJECT_KEY }}" \
|
|
-Dsonar.sources=. \
|
|
-Dsonar.sourceEncoding=UTF-8
|