-
Notifications
You must be signed in to change notification settings - Fork 1
33 lines (31 loc) · 1.08 KB
/
sonarcloud.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: SonarCloud Analysis
on: [ push ]
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- uses: actions/checkout@v1
- name: Cache Maven Repo
id: cache-maven-repo
uses: actions/cache@v1
with:
path: /home/runner/.m2/repository
key: ${{ runner.os }}-maven-repo
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 17
- name: Build with Maven
run: mvn -B --no-transfer-progress org.jacoco:jacoco-maven-plugin:prepare-agent package --file pom.xml --settings settings.xml
env:
USENAME: ${{github.actor}}
PASSWORD: ${{ secrets.GITHUB_TOKEN }}
- name: Sonarqube analysis
run: mvn -B --no-transfer-progress initialize sonar:sonar --file pom.xml --settings settings.xml
env:
USENAME: ${{github.actor}}
PASSWORD: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}