Skip to content

Commit

Permalink
[CI] Add smoke test for --enable-preview
Browse files Browse the repository at this point in the history
  • Loading branch information
jerboaa committed Jan 15, 2024
1 parent 154dabd commit 28665a9
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/buildJDK.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,19 @@ jobs:
${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 21 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:
Expand Down Expand Up @@ -194,8 +205,19 @@ jobs:
${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 21 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:
Expand Down Expand Up @@ -295,7 +317,23 @@ jobs:
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 21 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: |
Expand Down Expand Up @@ -396,8 +434,19 @@ jobs:
${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 21 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:
Expand Down

0 comments on commit 28665a9

Please sign in to comment.