-
Notifications
You must be signed in to change notification settings - Fork 2
115 lines (97 loc) · 3.4 KB
/
build.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
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
matrix-build:
strategy:
matrix:
java: [21]
os: ['ubuntu-latest', 'windows-latest']
env:
DEFAULT_JAVA: 21
DEFAULT_OS: 'ubuntu-latest'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.java }}
cancel-in-progress: true
name: Build on ${{ matrix.os }} with Java ${{ matrix.java }}
runs-on: ${{ matrix.os }}
permissions:
contents: read
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'gradle'
- uses: gradle/wrapper-validation-action@v2
- name: Cache SonarQube packages
uses: actions/cache@v4
if: ${{ env.DEFAULT_JAVA == matrix.java && env.DEFAULT_OS == matrix.os }}
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-java-${{ matrix.java }}-sonar
restore-keys: ${{ runner.os }}-java-${{ matrix.java }}-sonar
- name: Build with Gradle using Java ${{ matrix.java }}
run: |
./gradlew build --info --warning-mode=summary -PskipFlakyTests=true -PjavaVersion=${{ matrix.java }}
- name: Archive executable JAR
uses: actions/upload-artifact@v4
if: ${{ env.DEFAULT_JAVA == matrix.java && env.DEFAULT_OS == matrix.os }}
with:
name: executable-jar
path: jfxui/build/libs/white-rabbit-fx-*.jar
if-no-files-found: error
- name: Archive test reports for ${{ matrix.os }} using Java ${{ matrix.java }}
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: test-reports-${{ matrix.os }}-java-${{ matrix.java }}
path: "**/build/reports/tests/*/**"
if-no-files-found: error
- name: Sonar analysis
if: ${{ env.DEFAULT_JAVA == matrix.java && env.DEFAULT_OS == matrix.os && env.SONAR_TOKEN != null }}
run: |
./gradlew sonarqube -Dsonar.token=$SONAR_TOKEN --info --warning-mode=summary -PjavaVersion=${{ matrix.java }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Build native package for ${{ runner.os }} using Java ${{ matrix.java }}
if: ${{ env.DEFAULT_JAVA == matrix.java }}
run: |
./gradlew jpackage createChecksums --info --warning-mode=summary -PjavaVersion=${{ matrix.java }}
- name: Stop Gradle Daemon
run: |
./gradlew -status
./gradlew -stop
- name: Archive test reports for ${{ runner.os }}
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: test-reports-${{ runner.os }}
path: "**/build/reports/tests/*/**"
- name: Archive native package for ${{ runner.os }}
uses: actions/upload-artifact@v4
if: ${{ env.DEFAULT_JAVA == matrix.java }}
with:
name: packages-${{ runner.os }}
path: jfxui/build/jpackage-dist/*
- name: Archive checksums for ${{ runner.os }}
uses: actions/upload-artifact@v4
if: ${{ env.DEFAULT_JAVA == matrix.java }}
with:
name: checksums-${{ runner.os }}
path: jfxui/build/generatedChecksums/*
build:
needs: matrix-build
runs-on: ubuntu-latest
steps:
- run: echo "Build successful"