forked from AxonFramework/AxonFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (56 loc) · 1.95 KB
/
pullrequest.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
name: Axon Framework
on:
pull_request:
paths-ignore:
- 'docs/**'
- '.github/workflows/docs.yml'
jobs:
build:
name: Test and Build on JDK ${{ matrix.java-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- java-version: 8
sonar-enabled: false
- java-version: 11
sonar-enabled: false
- java-version: 17
sonar-enabled: true
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3.11.0
with:
distribution: 'zulu'
java-version: ${{ matrix.java-version }}
cache: "maven"
server-id: sonatype
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Regular Build
if: ${{ !matrix.sonar-enabled }}
run: |
./mvnw -B -U -Dstyle.color=always -Possrh -Pintegration-test clean verify
- name: Build with Coverage reports
if: matrix.sonar-enabled
run: |
./mvnw -B -U -Dstyle.color=always -Possrh -Dcoverage clean verify
- name: Sonar Analysis
if: ${{ success() && matrix.sonar-enabled && github.event.pull_request.head.repo.full_name == github.repository }}
run: |
./mvnw -B -Dstyle.color=always sonar:sonar \
-Dsonar.projectKey=AxonFramework_AxonFramework \
-Dsonar.organization=axonframework \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create test summary
uses: test-summary/action@v2
with:
paths: "**/target/surefire-reports/TEST-*.xml"
show: "fail, skip"
if: always() # This allows the build step to fail -- due to failing tests -- but still produce a test summary.