2025-02-17 21:26:18 +01:00
|
|
|
name: Run Sonarqube
|
|
|
|
|
2025-02-03 16:13:46 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2025-02-17 21:26:18 +01:00
|
|
|
pull_request_target:
|
|
|
|
branches:
|
|
|
|
- main
|
2025-02-03 16:13:46 +01:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
pull-requests: read
|
2025-02-04 11:18:02 +01:00
|
|
|
actions: read
|
2025-02-17 21:26:18 +01:00
|
|
|
|
2025-02-03 16:13:46 +01:00
|
|
|
jobs:
|
|
|
|
sonarqube:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2025-02-04 11:18:02 +01:00
|
|
|
- name: Harden Runner
|
2025-02-18 13:07:08 +01:00
|
|
|
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
|
2025-02-04 11:18:02 +01:00
|
|
|
with:
|
|
|
|
egress-policy: audit
|
|
|
|
|
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
|
|
with:
|
2025-02-13 11:39:05 +01:00
|
|
|
fetch-depth: 0
|
2025-02-04 11:18:02 +01:00
|
|
|
|
2025-02-10 11:18:27 +01:00
|
|
|
- name: Setup Gradle
|
2025-02-13 11:39:05 +01:00
|
|
|
uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0
|
2025-02-04 11:18:02 +01:00
|
|
|
|
|
|
|
- name: Build and analyze with Gradle
|
2025-02-03 16:13:46 +01:00
|
|
|
env:
|
2025-02-04 11:18:02 +01:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
|
|
DOCKER_ENABLE_SECURITY: true
|
|
|
|
STIRLING_PDF_DESKTOP_UI: true
|
|
|
|
run: |
|
|
|
|
./gradlew clean build sonar \
|
|
|
|
-Dsonar.projectKey=Stirling-Tools_Stirling-PDF \
|
|
|
|
-Dsonar.organization=stirling-tools \
|
|
|
|
-Dsonar.host.url=https://sonarcloud.io \
|
2025-02-10 11:18:27 +01:00
|
|
|
-Dsonar.login=${SONAR_TOKEN} \
|
2025-02-04 11:18:02 +01:00
|
|
|
-Dsonar.log.level=DEBUG \
|
|
|
|
--info
|
|
|
|
|
|
|
|
- name: Upload Problems Report on Failure
|
|
|
|
if: failure()
|
2025-02-10 11:47:45 +01:00
|
|
|
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
2025-02-04 11:18:02 +01:00
|
|
|
with:
|
|
|
|
name: gradle-problems-report
|
|
|
|
path: build/reports/problems/problems-report.html
|
|
|
|
retention-days: 7
|
|
|
|
|
|
|
|
- name: Upload Sonar Logs on Failure
|
|
|
|
if: failure()
|
2025-02-10 11:47:45 +01:00
|
|
|
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
2025-02-03 16:13:46 +01:00
|
|
|
with:
|
2025-02-04 11:18:02 +01:00
|
|
|
name: sonar-logs
|
|
|
|
path: |
|
|
|
|
.scannerwork/report-task.txt
|
|
|
|
build/sonar/
|
|
|
|
retention-days: 7
|