Skip to content

Instantly share code, notes, and snippets.

@Huluvu424242
Created December 23, 2023 16:14
Show Gist options
  • Save Huluvu424242/439b2dcb0af48fe1653157a33f277a49 to your computer and use it in GitHub Desktop.
Save Huluvu424242/439b2dcb0af48fe1653157a33f277a49 to your computer and use it in GitHub Desktop.
Aktion Sonarqube
name: Sonar Cloud Analysis
on:
push:
workflow_dispatch: {}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java-version }}
java-package: jdk
fetch-depth: 0
cache: 'maven'
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Sonar Qube Analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./mvnw -Pheadless -Psonarqube -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=Huluvu424242_fluent-builder.example
strategy:
matrix:
java-version:
- 17
- 19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment