-
-
Notifications
You must be signed in to change notification settings - Fork 646
414 lines (406 loc) · 14.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
# Builds LWJGL and runs tests.
# No artifacts are uploaded, see LWJGL-CI/lwjgl3 for that.
name: LWJGL Build
on:
workflow_dispatch:
push:
branches:
- master
env:
JAVA_HOME: jdk8
ANT_OPTS: -Xmx1G
LWJGL_BUILD_TYPE: nightly
jobs:
cache-kotlinc:
name: Compile templates and cache kotlinc output
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 3
- name: Download JDK
run: |
mkdir jdk8
curl https://cdn.azul.com/zulu/bin/zulu8.72.0.17-ca-jdk8.0.382-linux_x64.tar.gz | tar xz -C jdk8 --strip-components 1
- name: Compile templates
run: |
git clone https://github.com/LWJGL-CI/OculusSDK.git ../OculusSDK
ANT_OPTS=-Xmx4G ant -emacs compile-templates -Dbackend-threads=0
- name: Cache kotlinc output
uses: actions/cache/save@v3
with:
path: |
bin/classes/generator
bin/classes/templates
key: cache-kotlinc-${{ github.sha }}
enableCrossOsArchive: true
linux:
name: Linux
needs: cache-kotlinc
runs-on: ubuntu-latest
container:
image: centos:7
strategy:
fail-fast: false
matrix:
ARCH: [x64]
include:
- ARCH: x64
defaults:
run:
shell: bash
steps:
- name: Upgrade git
run: |
yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
yum -y install git
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 3
- name: Configure yum
run: |
yum -y install epel-release
yum -y update
- name: Install build dependencies
run: |
yum -y install centos-release-scl
yum -y install devtoolset-11-gcc-c++
yum -y install ant awscli zstd
- name: Install LWJGL dependencies
run: |
yum -y install libX11-devel libXt-devel gtk3-devel libdbus-1-dev
mkdir jdk8
curl -L https://cdn.azul.com/zulu/bin/zulu8.72.0.17-ca-fx-jdk8.0.382-linux_x64.tar.gz | tar xz -C jdk8 --strip-components 1
- name: Restore kotlinc output
uses: actions/cache/restore@v3
with:
path: |
bin/classes/generator
bin/classes/templates
key: cache-kotlinc-${{ github.sha }}
enableCrossOsArchive: true
fail-on-cache-miss: true
- name: Generate bindings
run: ant -emacs clean-generated generate
- name: Build Java
run: ant -emacs compile
- name: Build native
run: |
source scl_source enable devtoolset-11 || true
ant -emacs compile-native
- name: Run tests
run: |
source scl_source enable devtoolset-11 || true
ant -emacs tests
- name: Run demo with OpenJDK
run: |
source scl_source enable devtoolset-11 || true
ant demo -Dclass=org.lwjgl.demo.util.lz4.HelloLZ4
- name: Build GraalVM Native Image
run: |
source scl_source enable devtoolset-11 || true
mkdir jdk-graalvm-21
curl -L https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_linux-x64_bin.tar.gz | tar xz -C jdk-graalvm-21 --strip-components 1
jdk-graalvm-21/bin/native-image -cp \
bin/classes/lwjgl/core:\
bin/classes/lwjgl/lz4:\
bin/classes/samples:\
modules/samples/src/test/resources:\
bin/libs/java/joml.jar:\
bin/libs/native:\
config/native-image \
org.lwjgl.demo.util.lz4.HelloLZ4 --verbose --no-fallback
- name: Run demo with GraalVM JIT
run: |
source scl_source enable devtoolset-11 || true
JAVA_HOME=jdk-graalvm-21 ant demo -Dclass=org.lwjgl.demo.util.lz4.HelloLZ4
- name: Run demo with GraalVM Native Image
run: ./org.lwjgl.demo.util.lz4.hellolz4
linux-cross:
name: Linux Cross
needs: cache-kotlinc
runs-on: ubuntu-latest
container:
image: ${{matrix.CONTAINER}}
strategy:
fail-fast: false
matrix:
ARCH: [arm32, arm64, ppc64le, riscv64]
include:
# ----
- ARCH: arm32
CROSS_ARCH: armhf
CONTAINER: ubuntu:18.04
TRIPLET: arm-linux-gnueabihf
# ----
- ARCH: arm64
CROSS_ARCH: arm64
CONTAINER: ubuntu:18.04
TRIPLET: aarch64-linux-gnu
# ----
- ARCH: ppc64le
CROSS_ARCH: ppc64el
CONTAINER: ubuntu:18.04
TRIPLET: powerpc64le-linux-gnu
# ----
- ARCH: riscv64
CROSS_ARCH: riscv64
CONTAINER: ubuntu:20.04
TRIPLET: riscv64-linux-gnu
env:
LWJGL_BUILD_ARCH: ${{matrix.ARCH}}
defaults:
run:
shell: bash
steps:
- name: Upgrade git
run: |
apt-get -y update
apt-get -y install software-properties-common
apt-get -y install --reinstall ca-certificates
apt-get -y update
apt-get -y upgrade
add-apt-repository -y ppa:git-core/ppa
if: ${{ matrix.CONTAINER == 'ubuntu:18.04' }}
- run: |
apt-get -y update
apt-get install -y git
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 3
- name: Install dependencies
run: |
git config --global --add safe.directory $(pwd)
DEBIAN_FRONTEND=noninteractive apt-get -yq install ant awscli curl zstd gcc-${{matrix.TRIPLET}} g++-${{matrix.TRIPLET}} libc6-dev-${{matrix.CROSS_ARCH}}-cross
mkdir jdk8
curl -L https://cdn.azul.com/zulu/bin/zulu8.72.0.17-ca-fx-jdk8.0.382-linux_x64.tar.gz | tar xz -C jdk8 --strip-components 1
- name: Prepare cross-compilation for ${{matrix.CROSS_ARCH}}
run: |
sed -i 's/deb http/deb [arch=amd64,i386] http/' /etc/apt/sources.list
grep "ubuntu.com/ubuntu" /etc/apt/sources.list | tee /etc/apt/sources.list.d/ports.list
sed -i 's/amd64,i386/${{matrix.CROSS_ARCH}}/' /etc/apt/sources.list.d/ports.list
sed -i 's#http://.*/ubuntu#http://ports.ubuntu.com/ubuntu-ports#' /etc/apt/sources.list.d/ports.list
dpkg --add-architecture ${{matrix.CROSS_ARCH}}
apt-get clean
apt-get update || true
- name: Install cross-compilation dependencies
run: apt-get -yq -f --allow-unauthenticated --no-install-suggests --no-install-recommends install libgtk-3-dev:${{matrix.CROSS_ARCH}} libatk-bridge2.0-dev:${{matrix.CROSS_ARCH}} libgdk-pixbuf2.0-dev:${{matrix.CROSS_ARCH}} libglu-dev:${{matrix.CROSS_ARCH}} libgl1-mesa-glx:${{matrix.CROSS_ARCH}} libx11-dev:${{matrix.CROSS_ARCH}} libxt-dev:${{matrix.CROSS_ARCH}} libdbus-1-dev:${{matrix.CROSS_ARCH}} -o Dpkg::Options::="--force-overwrite"
- name: Restore kotlinc output
uses: actions/cache/restore@v3
with:
path: |
bin/classes/generator
bin/classes/templates
key: cache-kotlinc-${{ github.sha }}
enableCrossOsArchive: true
fail-on-cache-miss: true
- name: Generate bindings
run: ant -emacs clean-generated generate
- name: Build Java
run: ant -emacs compile
- name: Build native
run: ant -emacs compile-native -Dgcc.libpath.opengl=/usr/lib/${{matrix.TRIPLET}}/mesa
freebsd-cross:
name: FreeBSD Cross
needs: cache-kotlinc
runs-on: macos-latest
timeout-minutes: 20
strategy:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 3
fetch-tags: true
- name: Install dependencies
run: |
mkdir jdk8
curl -L https://cdn.azul.com/zulu/bin/zulu8.72.0.17-ca-fx-jdk8.0.382-macosx_x64.tar.gz | tar xz -C jdk8 --strip-components 1
- name: Restore kotlinc output
uses: actions/cache/restore@v3
with:
path: |
bin/classes/generator
bin/classes/templates
key: cache-kotlinc-${{ github.sha }}
enableCrossOsArchive: true
fail-on-cache-miss: true
- name: Generate bindings
run: ant -emacs clean-generated generate
- name: Build Java
run: ant -emacs compile
- name: Build & Test
uses: cross-platform-actions/[email protected]
with:
operating_system: freebsd
architecture: x86-64
version: '13.2'
memory: 8G
shell: bash
environment_variables: ANT_OPTS LWJGL_BUILD_TYPE
run: |
sudo pkg install -y openjdk8 apache-ant git gtk3 dbus
ant -emacs compile-native
ant -emacs tests
ant demo -Dclass=org.lwjgl.demo.util.lz4.HelloLZ4
macos:
name: macOS
needs: cache-kotlinc
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
ARCH: [x64, arm64]
env:
LWJGL_BUILD_ARCH: ${{matrix.ARCH}}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 3
- name: Install dependencies
run: |
mkdir jdk8
curl -L https://cdn.azul.com/zulu/bin/zulu8.72.0.17-ca-fx-jdk8.0.382-macosx_x64.tar.gz | tar xz -C jdk8 --strip-components 1
- name: Restore kotlinc output
uses: actions/cache/restore@v3
with:
path: |
bin/classes/generator
bin/classes/templates
key: cache-kotlinc-${{ github.sha }}
enableCrossOsArchive: true
fail-on-cache-miss: true
- name: Generate bindings
run: ant -emacs clean-generated generate
- name: Build Java
run: ant -emacs compile
- name: Build native
run: ant -emacs compile-native
- name: Run tests
run: ant -emacs tests
if: matrix.ARCH == 'x64'
- name: Run demo with OpenJDK
run: ant demo -Dclass=org.lwjgl.demo.util.lz4.HelloLZ4
if: matrix.ARCH == 'x64'
- name: Build GraalVM Native Image
run: |
mkdir jdk-graalvm-21
curl -L https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_macos-x64_bin.tar.gz | tar xz -C jdk-graalvm-21 --strip-components 1
jdk-graalvm-21/Contents/Home/bin/native-image -cp \
bin/classes/lwjgl/core:\
bin/classes/lwjgl/lz4:\
bin/classes/samples:\
modules/samples/src/test/resources:\
bin/libs/java/joml.jar:\
bin/libs/native:\
config/native-image \
org.lwjgl.demo.util.lz4.HelloLZ4 --verbose --no-fallback
if: matrix.ARCH == 'x64'
- name: Run demo with GraalVM JIT
run: JAVA_HOME=jdk-graalvm-21/Contents/Home ant demo -Dclass=org.lwjgl.demo.util.lz4.HelloLZ4
if: matrix.ARCH == 'x64'
- name: Run demo with GraalVM Native Image
run: ./org.lwjgl.demo.util.lz4.hellolz4
if: matrix.ARCH == 'x64'
windows:
name: Windows
needs: cache-kotlinc
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
ARCH: [x86, x64, arm64]
include:
- ARCH: x86
MSVC_ARCH: amd64_x86
- ARCH: x64
MSVC_ARCH: amd64
- ARCH: arm64
MSVC_ARCH: amd64_arm64
defaults:
run:
shell: cmd
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 3
- name: Configure MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.MSVC_ARCH }}
- name: Clone Oculus SDK
run: git clone https://github.com/LWJGL-CI/OculusSDK.git ../OculusSDK
if: contains(matrix.ARCH, 'arm') != true
- name: Install dependencies
run: |
Invoke-WebRequest https://cdn.azul.com/zulu/bin/zulu8.72.0.17-ca-fx-jdk8.0.382-win_x64.zip -OutFile jdk.zip
Expand-Archive -Path jdk.zip -DestinationPath .\
Rename-Item zulu8.72.0.17-ca-fx-jdk8.0.382-win_x64 jdk8
shell: pwsh
- name: Restore kotlinc output
uses: actions/cache/restore@v3
with:
path: |
bin/classes/generator
bin/classes/templates
key: cache-kotlinc-${{ github.sha }}
enableCrossOsArchive: true
fail-on-cache-miss: true
- name: Generate bindings
run: ant -emacs clean-generated generate
- name: Build Java
run: ant -emacs compile
- name: Switch to x86 JDK
run: |
Remove-Item -Recurse jdk8
Invoke-WebRequest https://cdn.azul.com/zulu/bin/zulu8.72.0.17-ca-fx-jdk8.0.382-win_i686.zip -OutFile jdk.zip
Expand-Archive -Path jdk.zip -DestinationPath .\
Rename-Item zulu8.72.0.17-ca-fx-jdk8.0.382-win_i686 jdk8
shell: pwsh
if: matrix.ARCH == 'x86'
- name: Build native
run: |
set LWJGL_BUILD_ARCH=${{matrix.ARCH}}
ant -emacs compile-native
- name: Run tests
run: ant -emacs tests
if: contains(matrix.ARCH, 'arm') != true
- name: Print test results
run: type bin\test\testng-results.xml
if: failure()
- name: Run demo with OpenJDK
run: ant demo -Dclass=org.lwjgl.demo.util.lz4.HelloLZ4
if: matrix.ARCH == 'x64'
- name: Download GraalVM
run: |
Invoke-WebRequest https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_windows-x64_bin.zip -OutFile jdk-graalvm.zip
Expand-Archive -Path jdk-graalvm.zip -DestinationPath .\
Get-ChildItem graalvm-jdk-21* | Rename-Item -newname jdk-graalvm-21
shell: pwsh
if: matrix.ARCH == 'x64'
- name: Build GraalVM Native Image
run: |
jdk-graalvm-21\bin\native-image -cp ^
bin/classes/lwjgl/core;^
bin/classes/lwjgl/lz4;^
bin/classes/samples;^
modules/samples/src/test/resources;^
bin/libs/java/joml.jar;^
bin/libs/native;^
config/native-image ^
org.lwjgl.demo.util.lz4.HelloLZ4 --verbose --no-fallback
if: matrix.ARCH == 'x64'
- name: Run demo with GraalVM JIT
run: |
set JAVA_HOME=jdk-graalvm-21
ant demo -Dclass=org.lwjgl.demo.util.lz4.HelloLZ4
if: matrix.ARCH == 'x64'
- name: Run demo with GraalVM Native Image
run: org.lwjgl.demo.util.lz4.hellolz4.exe
if: matrix.ARCH == 'x64'