2025-01-05 17:59:25 +01:00
|
|
|
---
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
types: [opened, synchronize, reopened]
|
2025-01-07 08:20:28 +01:00
|
|
|
workflow_dispatch:
|
2025-01-05 17:59:25 +01:00
|
|
|
|
|
|
|
name: SonarQube Scan
|
|
|
|
jobs:
|
|
|
|
sonarqube:
|
|
|
|
name: SonarQube Trigger
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2025-01-07 06:08:44 +01:00
|
|
|
|
|
|
|
- name: Checkout
|
2025-01-05 17:59:25 +01:00
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2025-01-07 06:08:44 +01:00
|
|
|
- name: Initialize Environment
|
|
|
|
uses: https://w9r.dev/w9r.dev/action-setup-environment@v1
|
2025-01-07 06:56:20 +01:00
|
|
|
with:
|
|
|
|
vault-role-id: ${{ secrets.VAULT_ROLE_ID }}
|
|
|
|
vault-secret-id: ${{ secrets.VAULT_SECRET_ID }}
|
2025-01-05 17:59:25 +01:00
|
|
|
|
|
|
|
- name: Cache SonarQube packages
|
|
|
|
uses: https://github.com/actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: ~/.sonar/cache
|
|
|
|
key: ${{ runner.os }}-sonar
|
|
|
|
restore-keys: ${{ runner.os }}-sonar
|
|
|
|
|
|
|
|
- name: SonarQube Scan
|
|
|
|
env:
|
2025-01-07 06:08:44 +01:00
|
|
|
SONAR_TOKEN: ${{ env.SONARQUBE_TOKEN }}
|
|
|
|
SONAR_HOST_URL: ${{ env.SONARQUBE_HOST }}
|
2025-01-05 17:59:25 +01:00
|
|
|
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
|