forked from TestFX/TestFX
-
Notifications
You must be signed in to change notification settings - Fork 1
127 lines (112 loc) · 4.22 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
116
117
118
119
120
121
122
123
124
125
126
127
---
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
actions: read
checks: write
contents: read
issues: read
packages: read
pull-requests: write
statuses: read
security-events: write
jobs:
build:
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
include:
- os: macos-latest
FILE: openjfx-24+884_headless_mac-aarch64_bin-sdk
- os: ubuntu-latest
FILE: openjfx-24+881_headless_linux-x86_64_bin-sdk
- os: windows-latest
FILE: openjfx-24+885_headless_windows-x86_64_bin-sdk
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 22
distribution: 'temurin'
- name: Download SDK (Linux/macOS)
if: runner.os != 'Windows'
run: |
wget -nv https://download2.gluonhq.com/openjfx/forks/johan/headless/${{ matrix.FILE }}.zip -O ${{ matrix.FILE }}.zip
unzip -q ${{ matrix.FILE }}.zip
echo "JAVAFX_HOME=${{ github.workspace }}/javafx-sdk-24" >> ${GITHUB_ENV}
- name: Download SDK (Windows)
if: runner.os == 'Windows'
run: |
Invoke-WebRequest https://download2.gluonhq.com/openjfx/forks/johan/headless/${{ matrix.FILE }}.zip -OutFile ${{ matrix.FILE }}.zip
Expand-Archive .\${{ matrix.FILE }}.zip -Force
Move-Item -Path .\${{ matrix.FILE }}\javafx-sdk-24 -Destination .\
echo "JAVAFX_HOME=${{ github.workspace }}\javafx-sdk-24" >> $env:GITHUB_ENV
- name: Cache Gradle Resources
uses: actions/cache@v4
with:
path: ~/.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build (Linux/macOS)
if: runner.os != 'Windows'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./gradlew -Dtestfx.headless=true versions check
- name: Build (Windows)
if: runner.os == 'Windows'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
.\gradlew -Dtestfx.headless=true versions check
shell: cmd
- name: Publish Test Results (Linux)
uses: EnricoMi/publish-unit-test-result-action/linux@v2
if: runner.os == 'Linux'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
check_name: Unit Test Results (${{ runner.os }})
report_individual_runs: true
check_run_annotations_branch: master
check_run_annotations: all tests, skipped tests
files: subprojects/**/build/test-results/**/*.xml
- name: Publish Test Results (macOS)
uses: EnricoMi/publish-unit-test-result-action/macos@v2
if: runner.os == 'macOS'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
check_name: Unit Test Results (${{ runner.os }})
report_individual_runs: true
check_run_annotations_branch: master
check_run_annotations: all tests, skipped tests
files: subprojects/**/build/test-results/**/*.xml
- name: Publish Test Results (Windows)
uses: EnricoMi/publish-unit-test-result-action/windows@v2
if: runner.os == 'Windows'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
check_name: Unit Test Results (${{ runner.os }})
report_individual_runs: true
check_run_annotations_branch: master
check_run_annotations: all tests, skipped tests
files: subprojects/**/build/test-results/**/*.xml
- name: Publish Snapshots
if: github.ref == 'refs/heads/master' && runner.os == 'Linux'
run: |
ver=$(./gradlew properties -q | grep "version:" | awk '{print $2}')
if [[ $ver == *"SNAPSHOT"* ]]
then
./gradlew publish -PgluonNexusDeployUsername=$NEXUS_USERNAME -PgluonNexusDeployPassword=$NEXUS_PASSWORD
fi
shell: bash
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}