forked from masesgroup/JCOReflector
-
Notifications
You must be signed in to change notification settings - Fork 0
831 lines (735 loc) · 36.9 KB
/
reflect_test_commit.yaml
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
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
# This is a basic workflow to help you get started with Actions
name: CI_REFLECT_TEST_COMMIT
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
# only trigger on branches, not on tags
branches: '**'
# This workflow contains two jobs called "check" and "build_windows"
jobs:
# Verify if a build is needed
check:
if: ${{ github.repository_owner == 'masesgroup' || (github.repository_owner != 'masesgroup' && github.ref_name != 'master') }} #do not execute on master outside main repo
name: Check changed files
outputs:
run_job: ${{ steps.check_files.outputs.run_job }}
runs-on: ubuntu-latest
steps:
- id: get_changed_files
uses: masesgroup/retrieve-changed-files@v3
with:
format: 'csv'
- id: check_files
run: |
mapfile -d ',' -t added_modified_files < <(printf '%s,' '${{ steps.get_changed_files.outputs.added_modified }}')
for added_modified_file in "${added_modified_files[@]}"; do
if [[ $added_modified_file == ".github/workflows/reflect_test_commit.yaml"* ]]; then
echo "$added_modified_file is under the directory '.github/workflows'."
echo "run_job=true" >> $GITHUB_OUTPUT
break
fi
if [[ $added_modified_file == "src/jvm/src/JCOReflector/"* ]]; then
echo "$added_modified_file is under the directory 'src/jvm/src/JCOReflector'."
echo "run_job=true" >> $GITHUB_OUTPUT
break
fi
if [[ $added_modified_file == "src/net/"* ]]; then
echo "$added_modified_file is under the directory 'src/'."
echo "run_job=true" >> $GITHUB_OUTPUT
break
fi
if [[ $added_modified_file == "tests/jvm/"* ]]; then
echo "$added_modified_file is under the directory 'tests/jvm/'."
echo "run_job=true" >> $GITHUB_OUTPUT
break
fi
done
# This workflow contains a single job called "build"
build_windows:
needs: check
if: needs.check.outputs.run_job == 'true'
# The type of runner that the job will run on
runs-on: windows-2022
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a set of commands using the runners shell
# Support longpaths
- name: Support long paths
run: git config --system core.longpaths true
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: '1'
# Runs a set of commands using the runners shell
- name: Build JCOReflectorCLI
run: dotnet build --no-incremental --configuration Release /p:Platform="Any CPU" src\net\JCOReflectorCLI.sln
- uses: nuget/[email protected]
with:
nuget-version: '5.x'
- run: nuget pack src\net\CLI\JCOReflectorCLI.nuspec -OutputDirectory .\bin
# Runs a set of commands using the runners shell
- name: Copy configuration file
run: |
Copy-Item .github\workflows\JCOReflectorCLI_net6.0.runtimeconfig.json -Destination bin\net6.0\MASES.JCOReflectorCLI.runtimeconfig.json -Force
Copy-Item .github\workflows\JCOReflectorCLI_net8.0.runtimeconfig.json -Destination bin\net8.0\MASES.JCOReflectorCLI.runtimeconfig.json -Force
- name: Remove Java files
run: |
Remove-Item .\src\jvm\src\net6.0 -Recurse -Force
Remove-Item .\src\jvm\src\net8.0 -Recurse -Force
Remove-Item .\src\jvm\src\net462 -Recurse -Force
- name: Reflect .NET 6.0 Java files
run: .\bin\net6.0\MASES.JCOReflectorCLI -JobType Reflect -JobFile .github\workflows\reflect_net6.0.job
- name: Reflect .NET 8.0 Java files
run: .\bin\net8.0\MASES.JCOReflectorCLI -JobType Reflect -JobFile .github\workflows\reflect_net8.0.job
- name: Reflect .NET Framework Java files
run: .\bin\net462\MASES.JCOReflectorCLI -JobType Reflect -JobFile .github\workflows\reflect_net462.job
- name: Build Java files .NET Core 6.0
run: .\bin\net6.0\MASES.JCOReflectorCLI -JobType Build -JobFile .github\workflows\build_win19.job -JDKFolder %JAVA_HOME_11_X64%
shell: cmd
- name: Build Java files .NET Core 8.0
run: .\bin\net8.0\MASES.JCOReflectorCLI -JobType Build -JobFile .github\workflows\build_win19.job -JDKFolder %JAVA_HOME_11_X64%
shell: cmd
- name: Build Java files .NET Framework
run: .\bin\net462\MASES.JCOReflectorCLI -JobType Build -JobFile .github\workflows\build_win19.job -JDKFolder %JAVA_HOME_11_X64%
shell: cmd
- name: Build JAR files .NET Core 6.0
run: .\bin\net6.0\MASES.JCOReflectorCLI -JobType CreateJars -JobFile .github\workflows\createjars_net6.0_win19.job -JDKFolder %JAVA_HOME_11_X64%
shell: cmd
- name: Build JAR files .NET Core 8.0
run: .\bin\net8.0\MASES.JCOReflectorCLI -JobType CreateJars -JobFile .github\workflows\createjars_net8.0_win19.job -JDKFolder %JAVA_HOME_11_X64%
shell: cmd
- name: Build JAR files .NET Framework
run: .\bin\net462\MASES.JCOReflectorCLI -JobType CreateJars -JobFile .github\workflows\createjars_net462_win19.job -JDKFolder %JAVA_HOME_11_X64%
shell: cmd
- name: Download Scala package
run: C:\msys64\usr\bin\wget.exe https://downloads.lightbend.com/scala/2.13.13/scala-2.13.13.zip
- name: Expand Scala package
run: Expand-Archive -LiteralPath '.\scala-2.13.13.zip' -DestinationPath .\bin\ -Force
- name: Save JCOReflector source in cache
uses: actions/cache/save@v4
with:
enableCrossOsArchive: true
path: ./src/jvm/
key: JCOReflector_source_${{ github.sha }}
- name: Save JCOReflector bin in cache
uses: actions/cache/save@v4
with:
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_windows_bin_${{ github.sha }}
# This workflow contains a single job called "build"
build_linux:
needs: build_windows
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: '1'
- name: Restore JCOReflector source from cache
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./src/jvm/
key: JCOReflector_source_${{ github.sha }}
# Runs a set of commands using the runners shell
- name: Build JCOReflectorCLI
run: dotnet build --no-incremental --framework net6.0 --configuration Release src/net/JCOReflectorCLI.sln
- name: Build Java files
run: dotnet bin/net6.0/MASES.JCOReflectorCLI.dll -JobType Build -JDKFolder $JAVA_HOME_11_X64 -JobFile .github/workflows/build_linux.job
- name: Build JAR files
run: dotnet bin/net6.0/MASES.JCOReflectorCLI.dll -JobType CreateJars -JDKFolder $JAVA_HOME_11_X64 -JobFile .github/workflows/createjars_net6.0_linux.job
- name: Build JCOReflectorCLI
run: dotnet build --no-incremental --framework net8.0 --configuration Release src/net/JCOReflectorCLI.sln
- name: Build Java files
run: dotnet bin/net8.0/MASES.JCOReflectorCLI.dll -JobType Build -JDKFolder $JAVA_HOME_11_X64 -JobFile .github/workflows/build_linux.job
- name: Build JAR files
run: dotnet bin/net8.0/MASES.JCOReflectorCLI.dll -JobType CreateJars -JDKFolder $JAVA_HOME_11_X64 -JobFile .github/workflows/createjars_net8.0_linux.job
- name: Extract commit SHA
run: |
echo "GITHUB_COMMIT_MESSAGE=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV
- name: Save JCOReflector bin in cache
uses: actions/cache/save@v4
with:
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_linux_bin_${{ github.sha }}
execute_java_tests_windows:
needs: build_windows
strategy:
fail-fast: false
matrix:
framework: [ 'net462', 'net6.0', 'net8.0' ]
jdk_vendor: [ 'temurin', 'zulu', 'microsoft', 'corretto', 'oracle']
jdk_version: [ '11', '17', '21' ] # only LTS versions
exclude:
- jdk_vendor: oracle
jdk_version: 11
runs-on: windows-latest
steps:
# Runs a set of commands using the runners shell
# Support longpaths
- name: Support long paths
run: git config --system core.longpaths true
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: '1'
- name: Restore JCOReflector bin from cache
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_windows_bin_${{ github.sha }}
- name: Set up JDK distribution
uses: actions/setup-java@v4
with: # running setup-java again overwrites the settings.xml
distribution: ${{ matrix.jdk_vendor }}
java-version: ${{ matrix.jdk_version }}
cache: 'maven'
- name: Build Java test source file for ${{ matrix.framework }}
run: javac -cp ./bin/${{ matrix.framework }}/JCOReflector.jar ./tests/jvm/java/src/hierarchy/*.java ./tests/jvm/java/src/mscorlib/*.java ./tests/jvm/java/src/nettest/*.java ./tests/jvm/java/src/refout/*.java
- name: Prepare extra argument
if: matrix.framework == 'net6.0'
shell: bash
run: echo "EXTRA_ARGUMENT=--CoreCLRApp:Microsoft.NET6.App" >> $GITHUB_ENV
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar;./tests/jvm/java/src/" mscorlib.HelloLock ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar;./tests/jvm/java/src/" mscorlib.HelloNET ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar;./tests/jvm/java/src/" mscorlib.HelloNETEvent ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar;./tests/jvm/java/src/" mscorlib.HelloIterator ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar;./tests/jvm/java/src/" hierarchy.HelloHierarchy ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar;./tests/jvm/java/src/" hierarchy.HelloInterfaces ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar;./tests/jvm/java/src/" nettest.HelloNETSocket ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar;./tests/jvm/java/src/" nettest.HelloNETSocket -async ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar;./tests/jvm/java/src/" refout.HelloRefOutBase ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar;./tests/jvm/java/src/" refout.HelloRefOut ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
execute_scala_tests_windows:
needs: build_windows
strategy:
fail-fast: false
matrix:
framework: [ 'net462', 'net6.0', 'net8.0' ]
jdk_vendor: [ 'temurin', 'zulu', 'microsoft', 'corretto', 'oracle']
jdk_version: [ '11', '17', '21' ] # only LTS versions
exclude:
- jdk_vendor: oracle
jdk_version: 11
runs-on: windows-latest
steps:
# Runs a set of commands using the runners shell
# Support longpaths
- name: Support long paths
run: git config --system core.longpaths true
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: '1'
- name: Restore JCOReflector bin from cache
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_windows_bin_${{ github.sha }}
- name: Set up JDK distribution
uses: actions/setup-java@v4
with: # running setup-java again overwrites the settings.xml
distribution: ${{ matrix.jdk_vendor }}
java-version: ${{ matrix.jdk_version }}
cache: 'maven'
- name: Prepare extra argument
if: matrix.framework == 'net6.0'
shell: bash
run: echo "EXTRA_ARGUMENT=--CoreCLRApp:Microsoft.NET6.App" >> $GITHUB_ENV
- name: Build Scala test source file for ${{ matrix.framework }}
shell: cmd
run: |
cd ./tests/jvm/scala
mkdir output
..\..\..\bin\scala-2.13.13\bin\scalac -toolcp "../../../bin/${{ matrix.framework }}/*" -d ./output ./src/main/scala/hierarchy/* ./src/main/scala/mscorlib/* ./src/main/scala/nettest/* ./src/main/scala/refout/*
- run: .\bin\scala-2.13.13\bin\scala -toolcp "./bin/${{ matrix.framework }}/*;./tests/jvm/scala/output" mscorlib.HelloLock ${{ env.EXTRA_ARGUMENT }}
shell: cmd
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: .\bin\scala-2.13.13\bin\scala -toolcp "./bin/${{ matrix.framework }}/*;./tests/jvm/scala/output" mscorlib.HelloNet ${{ env.EXTRA_ARGUMENT }}
shell: cmd
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: .\bin\scala-2.13.13\bin\scala -toolcp "./bin/${{ matrix.framework }}/*;./tests/jvm/scala/output" mscorlib.HelloNETEvent ${{ env.EXTRA_ARGUMENT }}
shell: cmd
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: .\bin\scala-2.13.13\bin\scala -toolcp "./bin/${{ matrix.framework }}/*;./tests/jvm/scala/output" mscorlib.HelloIterator ${{ env.EXTRA_ARGUMENT }}
shell: cmd
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: .\bin\scala-2.13.13\bin\scala -toolcp "./bin/${{ matrix.framework }}/*;./tests/jvm/scala/output" hierarchy.HelloHierarchy ${{ env.EXTRA_ARGUMENT }}
shell: cmd
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: .\bin\scala-2.13.13\bin\scala -toolcp "./bin/${{ matrix.framework }}/*;./tests/jvm/scala/output" hierarchy.HelloInterfaces ${{ env.EXTRA_ARGUMENT }}
shell: cmd
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: .\bin\scala-2.13.13\bin\scala -toolcp "./bin/${{ matrix.framework }}/*;./tests/jvm/scala/output" nettest.HelloNETSocket ${{ env.EXTRA_ARGUMENT }}
shell: cmd
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: .\bin\scala-2.13.13\bin\scala -toolcp "./bin/${{ matrix.framework }}/*;./tests/jvm/scala/output" nettest.HelloNETSocket -async ${{ env.EXTRA_ARGUMENT }}
shell: cmd
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: .\bin\scala-2.13.13\bin\scala -toolcp "./bin/${{ matrix.framework }}/*;./tests/jvm/scala/output" refout.HelloRefOutBase ${{ env.EXTRA_ARGUMENT }}
shell: cmd
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: .\bin\scala-2.13.13\bin\scala -toolcp "./bin/${{ matrix.framework }}/*;./tests/jvm/scala/output" refout.HelloRefOut ${{ env.EXTRA_ARGUMENT }}
shell: cmd
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: cd ./tests/jvm/scala && rmdir output /s /q
shell: cmd
continue-on-error: true
execute_java_tests_unix:
needs: build_linux
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-latest', 'macos-latest', 'macos-13' ]
framework: [ 'net6.0', 'net8.0' ]
jdk_vendor: [ 'temurin', 'zulu', 'microsoft', 'corretto', 'oracle']
jdk_version: [ '11', '17', '21' ] # only LTS versions
exclude:
- os: macos-latest
framework: net6.0
- os: macos-13
framework: net6.0
- jdk_vendor: oracle
jdk_version: 11
runs-on: ${{ matrix.os }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: '1'
- name: Restore JCOReflector bin from cache
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_linux_bin_${{ github.sha }}
- name: Set up JDK distribution
uses: actions/setup-java@v4
with: # running setup-java again overwrites the settings.xml
distribution: ${{ matrix.jdk_vendor }}
java-version: ${{ matrix.jdk_version }}
cache: 'maven'
- name: Prepare extra argument
if: matrix.framework == 'net6.0'
shell: bash
run: echo "EXTRA_ARGUMENT=--CoreCLRApp:Microsoft.NET6.App" >> $GITHUB_ENV
- name: Build Java test source file
run: javac -cp ./bin/${{ matrix.framework }}/JCOReflector.jar ./tests/jvm/java/src/hierarchy/*.java ./tests/jvm/java/src/mscorlib/*.java ./tests/jvm/java/src/nettest/*.java ./tests/jvm/java/src/refout/*.java
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar:./tests/jvm/java/src/" mscorlib.HelloLock ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar:./tests/jvm/java/src/" mscorlib.HelloNET ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar:./tests/jvm/java/src/" mscorlib.HelloNETEvent ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar:./tests/jvm/java/src/" mscorlib.HelloIterator ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar:./tests/jvm/java/src/" hierarchy.HelloHierarchy ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar:./tests/jvm/java/src/" hierarchy.HelloInterfaces ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar:./tests/jvm/java/src/" nettest.HelloNETSocket -server 127.0.0.1 ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar:./tests/jvm/java/src/" nettest.HelloNETSocket -async -server 127.0.0.1 ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
#java -cp "./bin/net6.0/JCOReflector.jar;./tests/jvm/java/src/" refout.HelloRefOutBase
#java -cp "./bin/net6.0/JCOReflector.jar;./tests/jvm/java/src/" refout.HelloRefOut
execute_scala_tests_linux:
needs: build_linux
strategy:
fail-fast: false
matrix:
framework: [ 'net6.0', 'net8.0' ]
jdk_vendor: [ 'temurin', 'zulu', 'microsoft', 'corretto', 'oracle']
jdk_version: [ '11', '17', '21' ] # only LTS versions
exclude:
- jdk_vendor: oracle
jdk_version: 11
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: '1'
- name: Restore JCOReflector bin from cache
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_linux_bin_${{ github.sha }}
- name: Set up JDK distribution
uses: actions/setup-java@v4
with: # running setup-java again overwrites the settings.xml
distribution: ${{ matrix.jdk_vendor }}
java-version: ${{ matrix.jdk_version }}
cache: 'maven'
- name: Download and install Scala package
run: |
sudo apt update
sudo apt-get install unzip
sudo apt-get install zip
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install scala 2.13.13
- name: Prepare extra argument
if: matrix.framework == 'net6.0'
shell: bash
run: echo "EXTRA_ARGUMENT=--CoreCLRApp:Microsoft.NET6.App" >> $GITHUB_ENV
- name: Build Scala test source file
run: |
source "$HOME/.sdkman/bin/sdkman-init.sh"
mkdir ./tests/jvm/scala/output
scalac -cp "./bin/${{ matrix.framework }}/*" -d ./tests/jvm/scala/output ./tests/jvm/scala/src/main/scala/hierarchy/* ./tests/jvm/scala/src/main/scala/mscorlib/* ./tests/jvm/scala/src/main/scala/nettest/* ./tests/jvm/scala/src/main/scala/refout/*
- run: source "$HOME/.sdkman/bin/sdkman-init.sh" && scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" mscorlib.HelloLock ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: source "$HOME/.sdkman/bin/sdkman-init.sh" && scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" mscorlib.HelloNet ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: source "$HOME/.sdkman/bin/sdkman-init.sh" && scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" mscorlib.HelloNETEvent ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: source "$HOME/.sdkman/bin/sdkman-init.sh" && scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" mscorlib.HelloIterator ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: source "$HOME/.sdkman/bin/sdkman-init.sh" && scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" hierarchy.HelloHierarchy ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: source "$HOME/.sdkman/bin/sdkman-init.sh" && scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" hierarchy.HelloInterfaces ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: source "$HOME/.sdkman/bin/sdkman-init.sh" && scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" nettest.HelloNETSocket ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: source "$HOME/.sdkman/bin/sdkman-init.sh" && scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" nettest.HelloNETSocket -async ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: source "$HOME/.sdkman/bin/sdkman-init.sh" && scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" refout.HelloRefOutBase ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: source "$HOME/.sdkman/bin/sdkman-init.sh" && scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" refout.HelloRefOut ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: rm -rf ./tests/jvm/scala/output
execute_scala_tests_mac:
needs: build_linux
strategy:
fail-fast: false
matrix:
os: [ 'macos-latest', 'macos-13' ]
framework: [ 'net8.0' ]
jdk_vendor: [ 'temurin', 'zulu', 'microsoft', 'corretto', 'oracle']
jdk_version: [ '11', '17', '21' ] # only LTS versions
exclude:
- os: macos-latest
framework: net6.0
- os: macos-13
framework: net6.0
- jdk_vendor: oracle
jdk_version: 11
runs-on: ${{ matrix.os }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: '1'
- name: Restore JCOReflector bin from cache
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_linux_bin_${{ github.sha }}
- name: Set up JDK distribution
uses: actions/setup-java@v4
with: # running setup-java again overwrites the settings.xml
distribution: ${{ matrix.jdk_vendor }}
java-version: ${{ matrix.jdk_version }}
cache: 'maven'
- name: Download and install Scala package
run: brew install [email protected]
- name: Export Scala root
if: matrix.os == 'macos-13'
run: |
echo "SCALA_BIN=/usr/local/opt/[email protected]/bin" >> $GITHUB_ENV
shell: bash
- name: Export Scala root
if: matrix.os == 'macos-latest'
run: |
echo "SCALA_BIN=/opt/homebrew/opt/[email protected]/bin" >> $GITHUB_ENV
shell: bash
- name: Prepare extra argument
if: matrix.framework == 'net6.0'
shell: bash
run: echo "EXTRA_ARGUMENT=--CoreCLRApp:Microsoft.NET6.App" >> $GITHUB_ENV
- name: Build Scala test source file
run: |
mkdir ./tests/jvm/scala/output
${{ env.SCALA_BIN }}/scalac -cp "./bin/${{ matrix.framework }}/*" -d ./tests/jvm/scala/output ./tests/jvm/scala/src/main/scala/hierarchy/* ./tests/jvm/scala/src/main/scala/mscorlib/* ./tests/jvm/scala/src/main/scala/nettest/* ./tests/jvm/scala/src/main/scala/refout/*
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" mscorlib.HelloLock ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" mscorlib.HelloNet ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" mscorlib.HelloNETEvent ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" mscorlib.HelloIterator ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" hierarchy.HelloHierarchy ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" hierarchy.HelloInterfaces ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" nettest.HelloNETSocket ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" nettest.HelloNETSocket -async ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" refout.HelloRefOutBase ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" refout.HelloRefOut ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: rm -rf ./tests/jvm/scala/output
execute_finalize:
needs: [execute_java_tests_windows, execute_scala_tests_windows, execute_java_tests_unix, execute_scala_tests_linux, execute_scala_tests_mac]
runs-on: windows-latest
steps:
# Runs a set of commands using the runners shell
# Support longpaths
- name: Support long paths
run: git config --system core.longpaths true
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: '1'
- name: Restore JCOReflector bin from cache
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_windows_bin_${{ github.sha }}
- name: Restore JCOReflector source from cache
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./src/jvm/
key: JCOReflector_source_${{ github.sha }}
- name: Compress release files
run: |
Compress-Archive -Path .\bin\net6.0\* -DestinationPath .\bin\net6.0.zip
Compress-Archive -Path .\bin\net8.0\* -DestinationPath .\bin\net8.0.zip
Compress-Archive -Path .\bin\net462\* -DestinationPath .\bin\net462.zip
- name: Extract commit SHA
run: |
echo "GITHUB_COMMIT_MESSAGE=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV
shell: bash
- name: Commit statistics changes
if: ${{ github.repository_owner == 'masesgroup'}} #do not push any changes outside main repo
uses: EndBug/add-and-commit@v9
with:
author_name: github-actions
author_email: 41898282+github-actions[bot]@users.noreply.github.com
add: '.\src\jvm\statistics\*.*'
message: Update statistics after commit ${{ env.GITHUB_COMMIT_MESSAGE }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit report changes
if: ${{ github.repository_owner == 'masesgroup'}} #do not push any changes outside main repo
uses: EndBug/add-and-commit@v9
with:
author_name: github-actions
author_email: 41898282+github-actions[bot]@users.noreply.github.com
add: '.\src\jvm\README.md'
message: Update README.md after commit ${{ env.GITHUB_COMMIT_MESSAGE }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit source changes
if: ${{ github.repository_owner == 'masesgroup'}} #do not push any changes outside main repo
uses: EndBug/add-and-commit@v9
with:
author_name: github-actions
author_email: 41898282+github-actions[bot]@users.noreply.github.com
add: '.\src\jvm\src\*.list'
message: Update assembly list after commit ${{ env.GITHUB_COMMIT_MESSAGE }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit source changes
if: ${{ github.repository_owner == 'masesgroup'}} #do not push any changes outside main repo
uses: EndBug/add-and-commit@v9
with:
author_name: github-actions
author_email: 41898282+github-actions[bot]@users.noreply.github.com
add: '.\src\jvm\src\*.java'
message: Update sources after commit ${{ env.GITHUB_COMMIT_MESSAGE }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: NuGet
path: .\bin\*nupkg
- uses: actions/upload-artifact@v4
with:
name: net6.0
path: .\bin\net6.0.zip
- uses: actions/upload-artifact@v4
with:
name: net8.0
path: .\bin\net8.0.zip
- uses: actions/upload-artifact@v4
with:
name: net462
path: .\bin\net462.zip