Skip to content

Comments updated

Comments updated #652

Workflow file for this run

name: Sonar
on:
push:
branches:
- main
- rest
pull_request:
types: [opened, synchronize, reopened]
permissions:
pull-requests: read
jobs:
build:
name: analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'
- 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: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
mvn --batch-mode --update-snapshots verify sonar:sonar \
-Dmaven.test.failure.ignore=true \
-Dcheckstyle.failOnViolation=false \
-Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml