2023-05-18 11:55:12 +02:00
|
|
|
name: SonarCloud
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master, development ]
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
permissions: read-all
|
|
|
|
|
|
|
|
env:
|
|
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
|
|
SONAR_ORGANIZATION: craftaro
|
|
|
|
SONAR_PROJECT_KEY: craftaro_EpicAnchors
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
Analyze:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2023-11-01 15:45:51 +01:00
|
|
|
- uses: actions/checkout@v4
|
2023-05-18 11:55:12 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Prepare Workspace
|
|
|
|
uses: craftaro/GH-Commons/.github/actions/setup_workspace@master
|
|
|
|
|
|
|
|
- name: 'Cache: SonarCloud'
|
2024-02-02 08:38:20 +01:00
|
|
|
uses: actions/cache@v4
|
2023-05-18 11:55:12 +02:00
|
|
|
with:
|
|
|
|
path: ~/.sonar/cache
|
|
|
|
key: ${{ runner.os }}-sonar
|
|
|
|
|
|
|
|
- name: Analyze project
|
|
|
|
run: >
|
|
|
|
mvn -B \
|
|
|
|
verify \
|
|
|
|
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
|
|
|
|
-Dsonar.host.url=https://sonarcloud.io \
|
|
|
|
"-Dsonar.organization=$SONAR_ORGANIZATION" \
|
|
|
|
"-Dsonar.projectKey=$SONAR_PROJECT_KEY"
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|