-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (91 loc) · 2.93 KB
/
main.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: JobRunr Pro Extension
on:
push:
branches:
- main
- axon-jobrunrpro-*.*.x
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
deploy-enabled: true
- java-version: 11
sonar-enabled: false
deploy-enabled: false
- java-version: 17
sonar-enabled: true
deploy-enabled: false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: ${{ matrix.java-version }}
cache: 'maven'
- name: Set Maven server credentials
uses: s4u/[email protected]
with:
servers: |
[{
"id": "sonatype",
"username": "${{ secrets.SONATYPE_TOKEN_ID }}",
"password": "${{ secrets.SONATYPE_TOKEN_PASS }}"
},{
"id": "JobRunrPro",
"username": "axoniq",
"password": "${{ secrets.JOB_RUNR_PRO_PASSWORD }}"
}]
- name: Regular Build
if: ${{ !matrix.sonar-enabled }}
run: |
./mvnw -B -U -Dstyle.color=always clean verify
env:
JOBRUNR_PRO_LICENSE: ${{ secrets.JOB_RUNR_PRO_LICENSE }}
- name: Build with Coverage reports
if: matrix.sonar-enabled
run: |
./mvnw -B -U -Dstyle.color=always -Dcoverage clean verify
env:
JOBRUNR_PRO_LICENSE: ${{ secrets.JOB_RUNR_PRO_LICENSE }}
- name: Sonar Analysis
if: matrix.sonar-enabled
run: |
./mvnw -B -Dstyle.color=always sonar:sonar \
-Dsonar.projectKey=AxonFramework_extension-jobrunrpro \
-Dsonar.organization=axonframework \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to Sonatype
if: success() && matrix.deploy-enabled
run: |
./mvnw -B -U -Dstyle.color=always deploy -DskipTests=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Notify success to Slack
if: success()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v2
with:
channel_id: CAGSEC92A
status: SUCCESS
color: good
- name: Notify failure to Slack
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v2
with:
channel_id: CAGSEC92A
status: FAILED
color: danger