2021-10-30 15:22:23 +02:00
|
|
|
name: SonarCloud
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-05-07 19:00:12 +02:00
|
|
|
branches: [ master, development ]
|
|
|
|
workflow_dispatch:
|
2021-10-30 15:22:23 +02:00
|
|
|
|
2022-08-07 19:33:38 +02:00
|
|
|
permissions: read-all
|
|
|
|
|
|
|
|
env:
|
|
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
2023-05-07 19:08:08 +02:00
|
|
|
SONAR_ORGANIZATION: craftaro
|
2023-06-11 00:41:05 +02:00
|
|
|
SONAR_PROJECT_KEY: craftaro_CraftaroCore
|
2022-08-07 19:33:38 +02:00
|
|
|
|
2021-10-30 15:22:23 +02:00
|
|
|
jobs:
|
2022-08-07 19:33:38 +02:00
|
|
|
Analyze:
|
2021-10-30 15:22:23 +02:00
|
|
|
runs-on: ubuntu-latest
|
2022-04-27 21:42:15 +02:00
|
|
|
|
2021-10-30 15:22:23 +02:00
|
|
|
steps:
|
2023-10-01 22:15:43 +02:00
|
|
|
- uses: actions/checkout@v4
|
2021-10-30 15:22:23 +02:00
|
|
|
with:
|
2022-08-07 19:33:38 +02:00
|
|
|
fetch-depth: 0
|
2021-10-30 15:22:23 +02:00
|
|
|
|
2022-08-07 19:33:38 +02:00
|
|
|
- name: Prepare Workspace
|
|
|
|
uses: ./.github/actions/setup_project_workspace
|
2022-03-18 14:32:20 +01:00
|
|
|
|
2021-10-30 15:22:23 +02:00
|
|
|
- name: 'Cache: SonarCloud'
|
2022-08-07 19:33:38 +02:00
|
|
|
uses: actions/cache@v3
|
2021-10-30 15:22:23 +02:00
|
|
|
with:
|
|
|
|
path: ~/.sonar/cache
|
|
|
|
key: ${{ runner.os }}-sonar
|
2022-11-26 20:26:01 +01:00
|
|
|
|
2021-10-30 15:22:23 +02:00
|
|
|
- name: Analyze project
|
2022-08-07 19:33:38 +02:00
|
|
|
run: >
|
2022-11-26 15:36:29 +01:00
|
|
|
mvn -B \
|
2022-08-07 19:33:38 +02:00
|
|
|
verify \
|
|
|
|
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
|
2023-05-07 19:08:08 +02:00
|
|
|
-Dsonar.host.url=https://sonarcloud.io \
|
|
|
|
"-Dsonar.organization=$SONAR_ORGANIZATION" \
|
2022-08-07 19:33:38 +02:00
|
|
|
"-Dsonar.projectKey=$SONAR_PROJECT_KEY"
|
2021-10-30 15:22:23 +02:00
|
|
|
env:
|
2022-08-07 19:33:38 +02:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|