-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (36 loc) · 985 Bytes
/
maven.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
34
35
36
37
38
39
40
41
42
43
44
45
name: Build Project
on:
push:
branches: [ "main" ]
pull_request:
permissions:
pull-requests: read # allows SonarCloud to decorate PRs with analysis results
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# JDK16 is needed for the tests
- name: Set up JDK 16
uses: actions/setup-java@v4
with:
java-version: '16'
distribution: 'temurin'
cache: maven
- name: validate project
run: mvn validate
- name: compile project
run: mvn compile
- name: test project
run: mvn test -Pcoverage
# JDK 17 is needed for sonar analysis
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Analyze with SonarCloud
run: mvn sonar:sonar -Pcoverage
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}