-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (61 loc) · 2.29 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
name: Main - Test, Build, and Deploy
on:
push:
branches:
- main
jobs:
build:
name: Test and Build on JDK ${{ matrix.java-version }}
runs-on: ubuntu-latest
continue-on-error: true # do not fail the whole job if one of the steps fails
strategy:
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
# Disabled due to https://youtrack.jetbrains.com/issue/KT-62389/JDK-21-Cannot-access-class-TimeUnit.-Check-your-module-classpath-for-missing-or-conflicting-dependencies
# Still runs perfectly fine on 21, just doesn't compile
# - java-version: 21
# sonar-enabled: false
# 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"
server-id: axoniq-nexus
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Test and Build
if: ${{ !matrix.sonar-enabled }}
run: |
./mvnw -B -U -Dstyle.color=always -Possrh clean verify
- name: Test and Build with Coverage reports
if: matrix.sonar-enabled
run: |
./mvnw -B -U -Dstyle.color=always -Dcoverage clean verify
- name: Sonar Analysis
if: ${{ success() && matrix.sonar-enabled }}
run: ./mvnw -B -Dstyle.color=always org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=AxonIQ_console-framework-client
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.CONSOLE_SONAR_TOKEN }}
- name: Deploy to Sonatype
if: matrix.deploy-enabled
run: |
./mvnw -B -U -Dstyle.color=always -Possrh deploy -DskipTests=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_USERNAME: ${{ secrets.DEVBOT_GITHUB_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.DEVBOT_GITHUB_TOKEN }}