This repository was archived by the owner on Oct 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (56 loc) · 1.81 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
name: Maven Build
on:
push:
pull_request:
jobs:
build:
name: Build with JDK ${{ matrix.java }}
runs-on: ubuntu-latest
strategy:
matrix:
java: [11, 14]
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Build with Maven
run: mvn -B package --file pom.xml
sonar:
name: Analysis with Sonar on JDK 11
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
# Disabling shallow clone is recommended for improving relevancy of reporting for Sonar
fetch-depth: 0
- uses: actions/[email protected]
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Analyze with SonarCloud
run: >
mvn -B
clean verify sonar:sonar
-Dsonar.projectKey=opencore_gdpdu-java
-Dsonar.organization=opencore
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.login=$SONAR_TOKEN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}