EpicAnchors/.github/workflows/sonarcloud.yml
Christian Koop 70741c3f7e
GitHub Actions: Switch to new Build + SonarCloud workflows
Based on craftaro/GH-Commons

These new workflows bring a lot of nice things - For example:
* signed jars
* Auto-Deploy to Maven Repo
* Using songoda.sprax.dev/repo/ as proxy for most repos/dependencies
* ...
2023-05-18 11:55:24 +02:00

43 lines
1000 B
YAML

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:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Prepare Workspace
uses: craftaro/GH-Commons/.github/actions/setup_workspace@master
- name: 'Cache: SonarCloud'
uses: actions/cache@v3
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 }}