-
Notifications
You must be signed in to change notification settings - Fork 8
502 lines (496 loc) · 21.5 KB
/
buildJDK.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
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
on:
push:
paths:
- 'build.java'
- '.github/workflows/buildJDK.yml'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'build.java'
- '.github/workflows/buildJDK.yml'
env:
MX_GIT_CACHE: refcache
JAVA_HOME: ${{ github.workspace }}/jdk
MAC_JAVA_HOME: ${{ github.workspace }}/jdk/Contents/Home
MANDREL_REPO: ${{ github.workspace }}/mandrel
MX_HOME: ${{ github.workspace }}/mx
# This ought to be a valid version parseable by Version.parse()
MANDREL_VERSION: 10.9.8.7-dev
MX_PYTHON: python3
PYTHONIOENCODING: utf-8
# The following aims to reduce CI CPU cycles by:
# 1. Cancelling any previous builds of this PR when pushing new changes to it
# 2. Cancelling any previous builds of a branch when pushing new changes to it in a fork
# 3. Cancelling any pending builds, but not active ones, when pushing to a branch in the main
# repository. This prevents us from constantly cancelling CI runs, while being able to skip
# intermediate builds. E.g., if we perform two pushes the first one will start a CI job and
# the second one will add another one to the queue; if we perform a third push while the
# first CI job is still running the previously queued CI job (for the second push) will be
# cancelled and a new CI job will be queued for the latest (third) push.
concurrency:
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'graalvm/mandrel-packaging' }}
jobs:
build-and-test:
name: Linux Build and test ${{ matrix.mandrel-ref }} branch/tag
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mandrel-ref: [mandrel/24.1]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: graalvm/mandrel.git
fetch-depth: 1
ref: ${{ matrix.mandrel-ref }}
path: ${{ github.workspace }}/mandrel
- name: Checkout MX
run: |
VERSION=$(jq -r .mx_version ${MANDREL_REPO}/common.json)
git clone ${GITHUB_SERVER_URL}/graalvm/mx --depth 1 --branch ${VERSION} ${MX_HOME}
./mx/mx --version
- uses: actions/cache@v3
with:
path: ~/.mx
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
restore-keys: |
${{ runner.os }}-mx-
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
restore-keys: |
${{ runner.os }}-${{ matrix.quarkus-name }}-maven-
- name: Get latest OpenJDK 23 with static libs
run: |
curl -sL https://api.adoptium.net/v3/binary/latest/23/ea/linux/x64/jdk/hotspot/normal/eclipse -o jdk.tar.gz
curl -sL https://api.adoptium.net/v3/binary/latest/23/ea/linux/x64/staticlibs/hotspot/normal/eclipse -o jdk-static-libs.tar.gz
mkdir -p ${JAVA_HOME}
tar xf jdk.tar.gz -C ${JAVA_HOME} --strip-components=1
tar xf jdk-static-libs.tar.gz -C ${JAVA_HOME} --strip-components=1
echo ${JAVA_HOME}
${JAVA_HOME}/bin/java --version
- name: Use python 3.10
# The minimum supported version is 3.9 see https://github.com/graalvm/mx/issues/249
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build Mandrel JDK
run: |
${JAVA_HOME}/bin/java -ea build.java --mx-home ${MX_HOME} --mandrel-repo ${MANDREL_REPO} --mandrel-version "${MANDREL_VERSION}" --archive-suffix tar.gz
export MANDREL_VERSION_UNTIL_SPACE="$( echo ${MANDREL_VERSION} | sed -e 's/\([^ ]*\).*/\1/;t' )"
export ARCHIVE_NAME="mandrel-java23-linux-amd64-${MANDREL_VERSION_UNTIL_SPACE}.tar.gz"
mv ${ARCHIVE_NAME} mandrel-java23-linux-amd64.tar.gz
- name: Smoke tests
run: |
export MANDREL_VERSION_UNTIL_SPACE="$( echo ${MANDREL_VERSION} | sed -e 's/\([^ ]*\).*/\1/;t' )"
export MANDREL_HOME=${PWD}/mandrel-java23-${MANDREL_VERSION_UNTIL_SPACE}
${MANDREL_HOME}/bin/native-image --version
${MANDREL_HOME}/bin/native-image --version | grep "${MANDREL_VERSION}"
echo "
public class HelloStrict {
public static void main(String[] args) {
System.out.printf(
\"Hello %1$,.12f %2$,.12f %3$,.12f %n\"
, StrictMath.cos(0.0)
, StrictMath.IEEEremainder(3.0, 5.0)
, StrictMath.IEEEremainder(-16.3, 4.1)
);
}
}
" > HelloStrict.java
${MANDREL_HOME}/bin/javac HelloStrict.java
${MANDREL_HOME}/bin/java HelloStrict | tee java.txt
${MANDREL_HOME}/bin/native-image HelloStrict
./hellostrict | tee native.txt
diff java.txt native.txt
rm -f java.txt native.txt
${MANDREL_HOME}/bin/native-image --macro:native-image-launcher
${MANDREL_HOME}/bin/native-image --version
echo "
void main() {
System.out.println(\"Implicitly declared classes.\");
}
" > ImplicitClass.java
${MANDREL_HOME}/bin/javac --enable-preview --release 23 ImplicitClass.java
${MANDREL_HOME}/bin/java --enable-preview ImplicitClass | tee java.txt
${MANDREL_HOME}/bin/native-image --enable-preview ImplicitClass
./implicitclass | tee native.txt
diff java.txt native.txt
- name: Upload Mandrel build
uses: actions/upload-artifact@v3
with:
name: mandrel-java23-linux-amd64-test-build
path: mandrel-java23-linux-amd64.tar.gz
- name: Build Mandrel JDK with tarxz suffix
run: |
${JAVA_HOME}/bin/java -ea build.java --mx-home ${MX_HOME} --mandrel-repo ${MANDREL_REPO} --mandrel-version "${MANDREL_VERSION}" --archive-suffix tarxz --skip-clean --skip-java --skip-native
export MANDREL_VERSION_UNTIL_SPACE="$( echo ${MANDREL_VERSION} | sed -e 's/\([^ ]*\).*/\1/;t' )"
export ARCHIVE_NAME="mandrel-java23-linux-amd64-${MANDREL_VERSION_UNTIL_SPACE}.tarxz"
mv ${ARCHIVE_NAME} mandrel-java23-linux-amd64.tarxz
- name: Upload tarxz Mandrel build
uses: actions/upload-artifact@v3
with:
name: mandrel-java23-linux-amd64-test-build-tarxz
path: mandrel-java23-linux-amd64.tarxz
build-and-test-on-mac:
name: ${{ matrix.os }} Build and test ${{ matrix.mandrel-ref }} branch/tag
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, macos-13]
mandrel-ref: [mandrel/24.1]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: graalvm/mandrel.git
fetch-depth: 1
ref: ${{ matrix.mandrel-ref }}
path: ${{ github.workspace }}/mandrel
- uses: actions/checkout@v3
with:
repository: graalvm/mx.git
fetch-depth: 1
ref: master
path: ${{ github.workspace }}/mx
- uses: actions/cache@v3
with:
path: ~/.mx
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
restore-keys: |
${{ runner.os }}-mx-
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
restore-keys: |
${{ runner.os }}-${{ matrix.quarkus-name }}-maven-
- name: Get runner architecture
id: arch
run: |
export ARCH=$(echo ${{ runner.arch }} | tr '[:upper:]' '[:lower:]' | sed 's/arm64/aarch64/')
echo "ARCH=${ARCH}"
echo "ARCH=${ARCH}" >> "$GITHUB_OUTPUT"
- name: Get latest OpenJDK 23 with static libs
env:
ARCH: ${{ steps.arch.outputs.ARCH }}
run: |
curl -sL https://api.adoptium.net/v3/binary/latest/23/ea/mac/${ARCH}/jdk/hotspot/normal/eclipse -o jdk.tar.gz
curl -sL https://api.adoptium.net/v3/binary/latest/23/ea/mac/${ARCH}/staticlibs/hotspot/normal/eclipse -o jdk-static-libs.tar.gz
mkdir -p ${JAVA_HOME}
tar xf jdk.tar.gz -C ${JAVA_HOME} --strip-components=1
tar xf jdk-static-libs.tar.gz -C ${JAVA_HOME} --strip-components=1
# work-around for https://github.com/adoptium/temurin-build/issues/3602
pushd ${MAC_JAVA_HOME}
if [[ -e lib/static/darwin-arm64 ]]; then
if [[ "$ARCH" == "x64" ]]; then
mv lib/static/darwin-arm64 lib/static/darwin-amd64
else
mv lib/static/darwin-arm64 lib/static/darwin-${ARCH}
fi
fi
popd
echo ${MAC_JAVA_HOME}
${MAC_JAVA_HOME}/bin/java --version
- name: Use python 3.10
# mx uses distutils which is no longer available in python 3.12 which is the default in macos-latest
# use 3.10 instead (the minimum supported version is 3.9) see https://github.com/graalvm/mx/issues/249
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build Mandrel JDK
id: build
env:
ARCH: ${{ steps.arch.outputs.ARCH }}
run: |
export JAVA_HOME=${MAC_JAVA_HOME}
${MAC_JAVA_HOME}/bin/java -ea build.java --mx-home ${MX_HOME} --mandrel-repo ${MANDREL_REPO} --mandrel-version "${MANDREL_VERSION}" --archive-suffix tar.gz
export MANDREL_VERSION_UNTIL_SPACE="$( echo ${MANDREL_VERSION} | sed -e 's/\([^ ]*\).*/\1/;t' )"
export ARCH=$( echo ${ARCH} | sed 's/x64/amd64/' )
export ARCHIVE_NAME="mandrel-java23-darwin-${ARCH}-${MANDREL_VERSION_UNTIL_SPACE}.tar.gz"
mv ${ARCHIVE_NAME} mandrel-java23-darwin-${ARCH}.tar.gz
echo "ARCH=${ARCH}" >> "$GITHUB_OUTPUT"
- name: Smoke tests
run: |
export MANDREL_VERSION_UNTIL_SPACE="$( echo ${MANDREL_VERSION} | sed -e 's/\([^ ]*\).*/\1/;t' )"
export MANDREL_HOME=${PWD}/mandrel-java23-${MANDREL_VERSION_UNTIL_SPACE}/Contents/Home
${MANDREL_HOME}/bin/native-image --version
${MANDREL_HOME}/bin/native-image --version | grep "${MANDREL_VERSION}"
echo "
public class HelloStrict {
public static void main(String[] args) {
System.out.printf(
\"Hello %1$,.12f %2$,.12f %3$,.12f %n\"
, StrictMath.cos(0.0)
, StrictMath.IEEEremainder(3.0, 5.0)
, StrictMath.IEEEremainder(-16.3, 4.1)
);
}
}
" > HelloStrict.java
${MANDREL_HOME}/bin/javac HelloStrict.java
${MANDREL_HOME}/bin/java HelloStrict | tee java.txt
${MANDREL_HOME}/bin/native-image HelloStrict
./hellostrict | tee native.txt
diff java.txt native.txt
rm -f java.txt native.txt
${MANDREL_HOME}/bin/native-image --macro:native-image-launcher
${MANDREL_HOME}/bin/native-image --version
echo "
void main() {
System.out.println(\"Implicitly declared classes.\");
}
" > ImplicitClass.java
${MANDREL_HOME}/bin/javac --enable-preview --release 23 ImplicitClass.java
${MANDREL_HOME}/bin/java --enable-preview ImplicitClass | tee java.txt
${MANDREL_HOME}/bin/native-image --enable-preview ImplicitClass
./implicitclass | tee native.txt
diff java.txt native.txt
- name: Upload Mandrel build
uses: actions/upload-artifact@v3
env:
ARCH: ${{ steps.build.outputs.ARCH }}
with:
name: mandrel-java23-darwin-${ARCH}-test-build
path: mandrel-java23-darwin-${ARCH}.tar.gz
build-and-test-on-windows:
name: Windows Build and test ${{ matrix.mandrel-ref }} branch/tag
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
mandrel-ref: [mandrel/24.1]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: graalvm/mandrel.git
fetch-depth: 1
ref: ${{ matrix.mandrel-ref }}
path: ${{ github.workspace }}/mandrel
- name: Checkout MX
shell: bash
run: |
VERSION=$(jq -r .mx_version ${MANDREL_REPO}/common.json)
git clone ${GITHUB_SERVER_URL}/graalvm/mx --depth 1 --branch ${VERSION} ${MX_HOME}
./mx/mx --version
- uses: actions/cache@v3
with:
path: ~/.mx
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
restore-keys: |
${{ runner.os }}-mx-
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
restore-keys: |
${{ runner.os }}-${{ matrix.quarkus-name }}-maven-
- name: Get latest OpenJDK 23 with static libs
run: |
$wc = New-Object System.Net.WebClient
$wc.DownloadFile("https://api.adoptium.net/v3/binary/latest/23/ea/windows/x64/jdk/hotspot/normal/eclipse", "$Env:temp\jdk.zip")
Expand-Archive "$Env:temp\jdk.zip" -DestinationPath "$Env:temp"
Move-Item -Path "$Env:temp\jdk-*" -Destination $Env:JAVA_HOME
$wc.DownloadFile("https://api.adoptium.net/v3/binary/latest/23/ea/windows/x64/staticlibs/hotspot/normal/eclipse", "$Env:temp\jdk-staticlibs.zip")
Expand-Archive "$Env:temp\jdk-staticlibs.zip" -DestinationPath "$Env:temp"
Move-Item -Path "$Env:temp\jdk-*\lib\static" -Destination $Env:JAVA_HOME\lib\
Remove-Item -Recurse "$Env:temp\jdk-*"
& $Env:JAVA_HOME\bin\java -version
- name: Use python 3.10
# The minimum supported version is 3.9 see https://github.com/graalvm/mx/issues/249
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build Mandrel
run: |
cmd.exe /c "call `"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars64.txt"
Get-Content "$Env:temp\vcvars64.txt" | Foreach-Object {
if ($_ -match "^(.*?)=(.*)$") {
Set-Content "Env:\$($matches[1])" $matches[2]
}
}
& $Env:JAVA_HOME\bin\java -ea build.java `
--mx-home $Env:MX_HOME `
--mandrel-version $Env:MANDREL_VERSION `
--mandrel-repo $Env:MANDREL_REPO `
--archive-suffix zip
- name: Smoke tests
run: |
cmd.exe /c "call `"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars64.txt"
Get-Content "$Env:temp\vcvars64.txt" | Foreach-Object {
if ($_ -match "^(.*?)=(.*)$") {
Set-Content "Env:\$($matches[1])" $matches[2]
}
}
$MANDREL_VERSION_UNTIL_SPACE=$Env:MANDREL_VERSION -replace "^(.*?) .*$","`$1"
$MANDREL_HOME=".\mandrel-java23-$MANDREL_VERSION_UNTIL_SPACE"
$VERSION=(& $MANDREL_HOME\bin\native-image.cmd --version)
Write-Host $VERSION
if ("$VERSION" -NotMatch "$Env:MANDREL_VERSION") {
exit 1
}
Set-Content -Path 'HelloStrict.java' -Value "
public class HelloStrict {
public static void main(String[] args) {
System.out.printf(
`"Hello %1$,.12f %2$,.12f %3$,.12f %n`"
, StrictMath.cos(0.0)
, StrictMath.IEEEremainder(3.0, 5.0)
, StrictMath.IEEEremainder(-16.3, 4.1)
);
}
}
"
& $MANDREL_HOME\bin\javac HelloStrict.java
& $MANDREL_HOME\bin\java HelloStrict | Set-Content java.txt
& $MANDREL_HOME\bin\native-image.cmd HelloStrict
& ./hellostrict | Set-Content native.txt
$DIFF=(Compare-Object -CaseSensitive (Get-Content java.txt) (Get-Content native.txt))
if ($DIFF -ne $null) {
Write-Host $DIFF
exit 1
}
& Remove-Item -Path java.txt -Force
& Remove-Item -Path native.txt -Force
& ${MANDREL_HOME}/bin/native-image.cmd --macro:native-image-launcher
Set-Content -Path 'ImplicitClass.java' -Value "
void main() {
System.out.println(`"Implicitly declared classes.`");
}
"
& $MANDREL_HOME\bin\javac --enable-preview --release 23 ImplicitClass.java
& $MANDREL_HOME\bin\java --enable-preview ImplicitClass | Set-Content java.txt
& $MANDREL_HOME\bin\native-image.cmd --enable-preview ImplicitClass
& ./implicitclass | Set-Content native.txt
$DIFF=(Compare-Object -CaseSensitive (Get-Content java.txt) (Get-Content native.txt))
if ($DIFF -ne $null) {
Write-Host $DIFF
exit 1
}
- name: Rename mandrel archive
shell: bash
run: |
export MANDREL_VERSION_UNTIL_SPACE="$( echo ${MANDREL_VERSION} | sed -e 's/\([^ ]*\).*/\1/;t' )"
export ARCHIVE_NAME="mandrel-java23-windows-amd64-${MANDREL_VERSION_UNTIL_SPACE}.zip"
mv ${ARCHIVE_NAME} mandrel-java23-windows-amd64.zip
- name: Upload Mandrel build
uses: actions/upload-artifact@v3
with:
name: mandrel-java23-windows-amd64-test-build
path: mandrel-java23-windows-amd64.zip
build-and-test-2-step:
name: 2-step Linux Build and test ${{ matrix.mandrel-ref }} branch/tag
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mandrel-ref: [mandrel/24.1]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: graalvm/mandrel.git
fetch-depth: 1
ref: ${{ matrix.mandrel-ref }}
path: ${{ github.workspace }}/mandrel
- name: Checkout MX
run: |
VERSION=$(jq -r .mx_version ${MANDREL_REPO}/common.json)
git clone ${GITHUB_SERVER_URL}/graalvm/mx --depth 1 --branch ${VERSION} ${MX_HOME}
./mx/mx --version
- uses: actions/cache@v3
with:
path: ~/.mx
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
restore-keys: |
${{ runner.os }}-mx-
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
restore-keys: |
${{ runner.os }}-${{ matrix.quarkus-name }}-maven-
- name: Get latest OpenJDK 23 with static libs
run: |
curl -sL https://api.adoptium.net/v3/binary/latest/23/ea/linux/x64/jdk/hotspot/normal/eclipse -o jdk.tar.gz
curl -sL https://api.adoptium.net/v3/binary/latest/23/ea/linux/x64/staticlibs/hotspot/normal/eclipse -o jdk-static-libs.tar.gz
mkdir -p ${JAVA_HOME}
tar xf jdk.tar.gz -C ${JAVA_HOME} --strip-components=1
tar xf jdk-static-libs.tar.gz -C ${JAVA_HOME} --strip-components=1
echo ${JAVA_HOME}
${JAVA_HOME}/bin/java --version
- name: Use python 3.10
# The minimum supported version is 3.9 see https://github.com/graalvm/mx/issues/249
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build Mandrel JDK
run: |
# Build the Java bits
${JAVA_HOME}/bin/java -ea build.java \
--mx-home ${MX_HOME} \
--mandrel-repo ${MANDREL_REPO} \
--mandrel-version "${MANDREL_VERSION}" \
--skip-native \
--maven-install \
--maven-deploy \
--maven-version "${MANDREL_VERSION}-mysuffix0001" \
--maven-repo-id myRepo \
--maven-url "file:///tmp/myRepo" \
--mandrel-home temp-build
# Build the native bits
./temp-build/bin/java -ea build.java \
--mx-home ${MX_HOME} \
--mandrel-repo ${MANDREL_REPO} \
--mandrel-version "${MANDREL_VERSION}" \
--skip-java \
--archive-suffix tar.gz
export MANDREL_VERSION_UNTIL_SPACE="$( echo ${MANDREL_VERSION} | sed -e 's/\([^ ]*\).*/\1/;t' )"
export ARCHIVE_NAME="mandrel-java23-linux-amd64-${MANDREL_VERSION_UNTIL_SPACE}.tar.gz"
mv ${ARCHIVE_NAME} mandrel-java23-linux-amd64.tar.gz
- name: Smoke tests
run: |
export MANDREL_VERSION_UNTIL_SPACE="$( echo ${MANDREL_VERSION} | sed -e 's/\([^ ]*\).*/\1/;t' )"
export MANDREL_HOME=${PWD}/mandrel-java23-${MANDREL_VERSION_UNTIL_SPACE}
${MANDREL_HOME}/bin/native-image --version
${MANDREL_HOME}/bin/native-image --version | grep "${MANDREL_VERSION}"
echo "
public class HelloStrict {
public static void main(String[] args) {
System.out.printf(
\"Hello %1$,.12f %2$,.12f %3$,.12f %n\"
, StrictMath.cos(0.0)
, StrictMath.IEEEremainder(3.0, 5.0)
, StrictMath.IEEEremainder(-16.3, 4.1)
);
}
}
" > HelloStrict.java
${MANDREL_HOME}/bin/javac HelloStrict.java
${MANDREL_HOME}/bin/java HelloStrict | tee java.txt
${MANDREL_HOME}/bin/native-image HelloStrict
./hellostrict | tee native.txt
diff java.txt native.txt
rm -f java.txt native.txt
${MANDREL_HOME}/bin/native-image --macro:native-image-launcher
${MANDREL_HOME}/bin/native-image --version
echo "
void main() {
System.out.println(\"Implicitly declared classes.\");
}
" > ImplicitClass.java
${MANDREL_HOME}/bin/javac --enable-preview --release 23 ImplicitClass.java
${MANDREL_HOME}/bin/java --enable-preview ImplicitClass | tee java.txt
${MANDREL_HOME}/bin/native-image --enable-preview ImplicitClass
./implicitclass | tee native.txt
diff java.txt native.txt
- name: Upload Mandrel build
uses: actions/upload-artifact@v3
with:
name: mandrel-java23-linux-amd64-2step-test-build
path: mandrel-java23-linux-amd64.tar.gz