Skip to content

Merge pull request #96 from SmartGecko44/dependabot/maven/de.tr7zw-it… #200

Merge pull request #96 from SmartGecko44/dependabot/maven/de.tr7zw-it…

Merge pull request #96 from SmartGecko44/dependabot/maven/de.tr7zw-it… #200

Workflow file for this run

name: SonarCloud analysis
on:
push:
branches:
- 'short-term/*'
- 'long-term/*'
- 'release/*'
- 'master'
pull_request:
branches: [ "master" ]
workflow_dispatch:
permissions:
pull-requests: read # allows SonarCloud to decorate PRs with analysis results
jobs:
Analysis:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@main
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Cache Sonar dependencies
uses: actions/cache@main
with:
path: |
~/.m2/repository
key: maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
sonar-
- name: Set up JDK
uses: actions/setup-java@main
with:
distribution: 'adopt'
java-version: '21'
- name: Build and Analyze with SonarCloud
run: mvn clean install sonar:sonar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate a token on Sonarcloud.io, add it to the secrets of this repo with the name SONAR_TOKEN (Settings > Secrets > Actions > add new repository secret)