-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (76 loc) · 2.25 KB
/
BuildSnapshot.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
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Build and publish on update
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'zulu'
cache: maven
- uses: s4u/maven-settings-action@v2.5.0
with:
sonatypeSnapshots: true
apacheSnapshots: true
servers: |
[{
"id": "ossrh",
"username": "${{ secrets.SONATYPE_USERNAME }}",
"password": "${{ secrets.SONATYPE_PASSWORD }}"
}]
- name: Package and test
run: mvn package -U -B
working-directory: pom
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: "**/target/surefire-reports/*.xml"
- name: Deploy
run: mvn deploy -Dmaven.test.skip -B
working-directory: pom
sonar:
name: Run Sonar analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Shallow clones should be disabled for a better relevancy of analysis
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'zulu'
cache: maven
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- uses: s4u/maven-settings-action@v2.5.0
with:
sonatypeSnapshots: true
apacheSnapshots: true
servers: |
[{
"id": "ossrh",
"username": "${{ secrets.SONATYPE_USERNAME }}",
"password": "${{ secrets.SONATYPE_PASSWORD }}"
}]
- name: Build and analyze
env:
# Needed to get PR information, if any
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B -P coverage verify sonar:sonar -Dsonar.projectKey=foal_gwt-language-tag -Dsonar.coverage.jacoco.xmlReportPaths='../**/jacoco.xml'
working-directory: pom