2021-07-01 14:47:30 +00:00
|
|
|
name: SonarCloud Scanner
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: [opened, synchronize, reopened]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
scan:
|
|
|
|
|
|
|
|
name: SonarCloud Scanner
|
|
|
|
runs-on: ubuntu-latest
|
2021-07-06 10:55:15 +00:00
|
|
|
|
2021-07-04 11:18:47 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
|
|
|
2021-07-01 14:47:30 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2021-11-02 18:12:06 +00:00
|
|
|
uses: actions/checkout@v2.4.0
|
2021-07-01 14:47:30 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2021-12-17 16:54:36 +00:00
|
|
|
- name: Set up JDK 16
|
2021-12-21 11:55:08 +00:00
|
|
|
uses: actions/setup-java@v2.5.0
|
2021-07-01 14:47:30 +00:00
|
|
|
with:
|
|
|
|
distribution: 'adopt'
|
2021-12-17 16:54:36 +00:00
|
|
|
java-version: '16'
|
|
|
|
java-package: jdk
|
|
|
|
architecture: x64
|
2021-07-01 14:47:30 +00:00
|
|
|
|
|
|
|
- name: Cache SonarCloud packages
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.sonar/cache
|
|
|
|
key: ${{ runner.os }}-sonar
|
|
|
|
restore-keys: ${{ runner.os }}-sonar
|
|
|
|
|
|
|
|
- name: Cache Maven packages
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.m2
|
|
|
|
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
|
|
|
restore-keys: ${{ runner.os }}-m2
|
|
|
|
|
|
|
|
- name: SonarCloud analysis
|
|
|
|
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
|
2021-07-06 10:55:15 +00:00
|
|
|
if: ${{ env.SONAR_TOKEN != 0 }}
|