-
-
Notifications
You must be signed in to change notification settings - Fork 22
87 lines (68 loc) · 2.27 KB
/
pr.yml
File metadata and controls
87 lines (68 loc) · 2.27 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Pull requests
on:
pull_request_target:
branches:
- 'master'
jobs:
verify:
name: Verify ${{ matrix.os }} jdk${{ matrix.java }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
java: [ 8, 11, 15 ]
exclude:
- os: ubuntu-latest
java: 11
steps:
- uses: actions/checkout@v2.3.4
with:
ref: 'refs/pull/${{ github.event.number }}/merge'
- uses: actions/cache@v2.1.3
with:
path: ~/.m2/repository
key: ${{ matrix.os }}-jdk${{ matrix.java }}-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ matrix.os }}-jdk${{ matrix.java }}-
- uses: actions/setup-java@v1.4.3
with:
java-version: ${{ matrix.java }}
- uses: s4u/maven-settings-action@v2.2.0
with:
sonatypeSnapshots: true
- run: mvn verify
sonar:
name: Verify Sonar ubuntu-latest jdk11
needs: verify
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
with:
ref: 'refs/pull/${{ github.event.number }}/merge'
fetch-depth: 0
- uses: actions/cache@v2.1.3
with:
path: |
~/.m2/repository
~/.sonar/cache
key: ubuntu-latest-jdk11-${{ hashFiles('**/pom.xml') }}
restore-keys: ubuntu-latest-jdk11-
- uses: actions/setup-java@v1.4.3
with:
java-version: 11
- uses: s4u/maven-settings-action@v2.2.0
with:
sonatypeSnapshots: true
- run: mvn verify
- run: mvn sonar:sonar
if: github.repository_owner == 's4u'
env:
SONARQUBE_SCANNER_PARAMS: >
{
"sonar.pullrequest.key": "${{ github.event.number }}",
"sonar.pullrequest.base": "${{ github.event.pull_request.base.ref }}",
"sonar.pullrequest.branch": "${{ github.event.pull_request.head.repo.full_name }}/${{ github.event.pull_request.head.ref }}",
"sonar.pullrequest.github.repository": "${{ github.repository }}",
"sonar.login": "${{ secrets.SONAR_TOKEN }}",
"sonar.scm.revision": "${{ github.event.pull_request.head.sha }}"
}