-
Notifications
You must be signed in to change notification settings - Fork 28
419 lines (417 loc) · 14.6 KB
/
test.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
name: 'build-test'
on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:
permissions:
contents: read
jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
npm install
- run: |
npm run all
test:
name: GraalVM
runs-on: ${{ matrix.os }}
strategy:
matrix:
java-version: ['22', '21', '17', '20', 'dev']
distribution: ['graalvm', 'graalvm-community']
os: [
ubuntu-latest,
macos-latest, # macOS on Apple silicon
macos-12, # macOS on Intel
windows-latest
]
set-gds-token: [false]
components: ['']
include:
- java-version: 'latest-ea'
distribution: 'graalvm'
os: ubuntu-latest
- java-version: '23-ea'
distribution: 'graalvm'
os: ubuntu-latest
- java-version: '21'
distribution: ''
os: ubuntu-latest
- java-version: 'dev'
distribution: ''
os: windows-latest
- java-version: '21'
distribution: 'graalvm-community'
os: ubuntu-latest
components: 'native-image' # should print a warning but not fail
- java-version: '21.0.0' # test for GA version (see #63)
distribution: 'graalvm'
os: ubuntu-latest
- java-version: '17'
distribution: 'graalvm'
os: ubuntu-latest
set-gds-token: true
- java-version: '17.0.13'
distribution: 'graalvm'
os: ubuntu-latest
set-gds-token: true
steps:
- uses: actions/checkout@v4
- name: Run setup-graalvm action
uses: ./
with:
java-version: ${{ matrix.java-version }}
distribution: ${{ matrix.distribution }}
github-token: ${{ secrets.GITHUB_TOKEN }}
components: ${{ matrix.components }}
gds-token: ${{ matrix.set-gds-token && secrets.GDS_TOKEN || '' }}
- name: Check environment
run: |
echo "GRAALVM_HOME: $GRAALVM_HOME"
if [[ "${{ matrix.java-version }}" == "dev" ]]; then
[[ "$GRAALVM_HOME" == *"$RUNNER_TEMP"* ]] || exit 12
else
[[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 23
fi
echo "JAVA_HOME: $JAVA_HOME"
java --version
java --version | grep "GraalVM" || exit 34
native-image --version
if: runner.os != 'Windows'
- name: Check Windows environment
run: |
echo "GRAALVM_HOME: $env:GRAALVM_HOME"
echo "JAVA_HOME: $env:JAVA_HOME"
java --version
native-image --version
test-ce: # make sure the action works on a clean machine without building
needs: test
name: CE ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
version: ['latest', 'dev']
java-version: ['17', '20']
components: ['native-image']
os: [macos-latest, windows-latest, ubuntu-latest]
exclude:
- version: 'latest'
java-version: '20'
- version: 'dev'
java-version: '19'
include:
- version: '22.2.0' # for update notifications
java-version: '17'
components: 'native-image'
os: ubuntu-20.04
- version: '21.2.0'
java-version: '8' # for JDK 8 notification
components: 'native-image'
os: ubuntu-latest
- version: '22.3.1'
java-version: '11' # for JDK 11 notification
components: 'native-image'
os: macos-12
- version: '22.3.1'
java-version: '17'
components: 'native-image'
os: windows-2022
- version: 'dev'
java-version: 'dev'
components: 'native-image'
os: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run setup-graalvm action
uses: ./
with:
version: ${{ matrix.version }}
java-version: ${{ matrix.java-version }}
components: ${{ matrix.components }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check environment
run: |
echo "GRAALVM_HOME: $GRAALVM_HOME"
if [[ "${{ matrix.version }}" == "dev" ]] && [[ "${{ matrix.java-version }}" == "dev" ]]; then
[[ "$GRAALVM_HOME" == *"$RUNNER_TEMP"* ]] || exit 12
else
[[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 23
fi
echo "JAVA_HOME: $JAVA_HOME"
java -version
java -version 2>&1 | grep "GraalVM" || exit 34
native-image --version
if [[ "${{ matrix.java-version }}" != "dev" ]]; then
gu list
fi
if: runner.os != 'Windows'
- name: Check Windows environment
run: |
echo "GRAALVM_HOME: $env:GRAALVM_HOME"
echo "JAVA_HOME: $env:JAVA_HOME"
java -version
native-image --version
gu.cmd remove native-image
if: runner.os == 'Windows'
test-ee:
needs: test
name: EE ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }}
if: github.event_name != 'pull_request'
runs-on: ${{ matrix.os }}
strategy:
matrix:
version: ['latest']
java-version: ['17']
components: ['native-image']
os: [macos-latest, windows-latest, ubuntu-latest]
include:
- version: '22.3.3'
java-version: '11'
components: 'native-image'
os: ubuntu-latest
- version: '22.3.3'
java-version: '17'
components: 'native-image'
os: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run setup-graalvm action
uses: ./
with:
version: ${{ matrix.version }}
gds-token: ${{ secrets.GDS_TOKEN }}
java-version: ${{ matrix.java-version }}
components: ${{ matrix.components }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check environment
run: |
echo "GRAALVM_HOME: $GRAALVM_HOME"
[[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 12
echo "JAVA_HOME: $JAVA_HOME"
java --version
java --version | grep -e "GraalVM EE" -e "Oracle GraalVM" || exit 23
native-image --version
gu list
if: runner.os != 'Windows'
- name: Check Windows environment
run: |
echo "GRAALVM_HOME: $env:GRAALVM_HOME"
echo "JAVA_HOME: $env:JAVA_HOME"
java --version
native-image --version
gu.cmd remove native-image
if: runner.os == 'Windows'
test-mandrel:
needs: test
name: ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
version: ['mandrel-22.2.0.0-Final', '23.0.1.2-Final', 'mandrel-latest']
java-version: ['17']
distribution: ['mandrel']
os: [windows-latest, ubuntu-latest]
include:
- version: 'mandrel-latest'
java-version: '17'
distribution: '' # test empty distribution for backward compatibility
os: ubuntu-latest
- version: '' # test with no version
java-version: '21'
distribution: 'mandrel'
os: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run setup-graalvm action
uses: ./
with:
version: ${{ matrix.version }}
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check environment
run: |
echo "GRAALVM_HOME: $GRAALVM_HOME"
[[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 12
echo "JAVA_HOME: $JAVA_HOME"
java --version
java --version | grep "Temurin" || exit 23
native-image --version
if: runner.os != 'Windows'
- name: Check Windows environment
run: |
echo "GRAALVM_HOME: $env:GRAALVM_HOME"
echo "JAVA_HOME: $env:JAVA_HOME"
java --version
native-image --version
if: runner.os == 'Windows'
test-liberica:
needs: test
name: Liberica (${{ matrix.java-version }}, '${{ matrix.java-package }}', ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
java-version: ['17', '21.0.2']
java-package: ['', 'jdk', 'jdk+fx']
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Run setup-graalvm action
uses: ./
with:
distribution: liberica
java-version: ${{ matrix.java-version }}
java-package: ${{ matrix.java-package }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check environment
run: |
echo "GRAALVM_HOME: $GRAALVM_HOME"
[[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 12
echo "JAVA_HOME: $JAVA_HOME"
java --version
java --version | fgrep -qw ${{ matrix.java-version }} || exit 23
native-image --version
native-image --version | fgrep -qw ${{ matrix.java-version }} || exit 24
if: runner.os != 'Windows'
- name: Check Windows environment
shell: pwsh
run: |
echo "GRAALVM_HOME: $env:GRAALVM_HOME"
echo "JAVA_HOME: $env:JAVA_HOME"
java --version
if (!(java --version | findstr \<${{ matrix.java-version }}\>)) {
exit 23
}
native-image --version
if (!(native-image --version | findstr \<${{ matrix.java-version }}\>)) {
exit 24
}
if: runner.os == 'Windows'
test-native-image-windows:
name: native-image on windows-latest
runs-on: windows-latest
permissions:
contents: read
pull-requests: write # for `native-image-pr-reports` option
steps:
- uses: actions/checkout@v4
- name: Run setup-graalvm action
uses: ./
with:
java-version: 'dev'
distribution: 'graalvm-community'
native-image-job-reports: 'true'
native-image-pr-reports: 'true'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build HelloWorld executable with GraalVM Native Image on Windows
run: |
echo 'public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }' > HelloWorld.java
javac HelloWorld.java
native-image HelloWorld
./helloworld
test-native-image-windows-msvc:
name: native-image on windows-2022
runs-on: windows-2022
permissions:
contents: read
pull-requests: write # for `native-image-pr-reports` option
steps:
- uses: actions/checkout@v4
- name: Run setup-graalvm action
uses: ./
with:
java-version: '17'
distribution: 'graalvm'
native-image-job-reports: 'true'
native-image-pr-reports: 'true'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build HelloWorld executable with GraalVM Native Image on Windows
run: |
echo 'public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }' > HelloWorld.java
javac HelloWorld.java
native-image HelloWorld
./helloworld
test-native-image-musl:
name: native-image-musl on ubuntu-latest
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write # for `native-image-pr-reports` option
steps:
- uses: actions/checkout@v4
- name: Run setup-graalvm action
uses: ./
with:
java-version: 'dev'
distribution: 'graalvm-community'
native-image-musl: 'true'
native-image-job-reports: 'true'
native-image-pr-reports: 'true'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build static HelloWorld executable with GraalVM Native Image and musl
run: |
echo 'public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }' > HelloWorld.java
javac HelloWorld.java
native-image --static --libc=musl HelloWorld
./helloworld
test-extensive:
name: extensive tests on ubuntu-latest
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write # for `native-image-pr-reports` option
steps:
- uses: actions/checkout@v4
- name: Run setup-graalvm action
uses: ./
with:
java-version: '17.0.8'
distribution: 'graalvm'
components: 'espresso,llvm-toolchain,native-image,nodejs,python,ruby,wasm'
set-java-home: 'false'
native-image-job-reports: 'true'
native-image-pr-reports: 'true'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check environment
run: |
echo "GRAALVM_HOME: $GRAALVM_HOME"
echo "JAVA_HOME: $JAVA_HOME"
[[ "$GRAALVM_HOME" != "$JAVA_HOME" ]] || exit 12
[[ $(which java) == *"graalvm"* ]] || exit 23
java --version
java -truffle --version
gu --version
gu list
[[ $(which lli) == *"graalvm"* ]] || exit 34
lli --version
native-image --version
[[ $(which node) == *"graalvm"* ]] || exit 45
node --version
graalpy --version
truffleruby --version
wasm --version
- name: Build HelloWorld.java with GraalVM Native Image
run: |
echo 'public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }' > HelloWorld.java
javac HelloWorld.java
native-image -g HelloWorld
./helloworld
# - name: Build Ruby-FFI with TruffleRuby
# run: |
# [[ $(which bundle) == *"graalvm"* ]] || exit 57
# git clone --depth 1 https://github.com/ffi/ffi.git
# pushd ffi > /dev/null
# # https://github.com/ffi/ffi/blob/447845cb3030194c79700c86fb388a12e6f81386/.github/workflows/ci.yml#L58-L62
# bundle install
# bundle exec rake libffi
# bundle exec rake compile
# bundle exec rake test
# popd > /dev/null
- name: Remove components
run: gu remove espresso llvm-toolchain nodejs python ruby wasm