Simplify complex Native Image template.

This commit is contained in:
Fabio Niephaus 2022-03-29 15:23:04 +02:00
parent 5a3116eab6
commit cf025f1a74
No known key found for this signature in database
GPG Key ID: F21CF5275F31DFD6
2 changed files with 8 additions and 15 deletions

View File

@ -67,7 +67,7 @@ jobs:
echo "GRAALVM_HOME: $env:GRAALVM_HOME" echo "GRAALVM_HOME: $env:GRAALVM_HOME"
echo "JAVA_HOME: $env:JAVA_HOME" echo "JAVA_HOME: $env:JAVA_HOME"
java --version java --version
native-image.cmd --version native-image --version
if: runner.os == 'Windows' if: runner.os == 'Windows'
test-ee: test-ee:
name: EE ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }} name: EE ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }}
@ -103,7 +103,7 @@ jobs:
echo "GRAALVM_HOME: $env:GRAALVM_HOME" echo "GRAALVM_HOME: $env:GRAALVM_HOME"
echo "JAVA_HOME: $env:JAVA_HOME" echo "JAVA_HOME: $env:JAVA_HOME"
java --version java --version
# native-image.cmd --version (activate after 22.1.0 is released) # native-image --version (activate after 22.1.0 is released)
if: runner.os == 'Windows' if: runner.os == 'Windows'
test-mandrel: test-mandrel:
name: ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }} name: ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }}
@ -134,7 +134,7 @@ jobs:
echo "GRAALVM_HOME: $env:GRAALVM_HOME" echo "GRAALVM_HOME: $env:GRAALVM_HOME"
echo "JAVA_HOME: $env:JAVA_HOME" echo "JAVA_HOME: $env:JAVA_HOME"
java --version java --version
native-image.cmd --version native-image --version
if: runner.os == 'Windows' if: runner.os == 'Windows'
test-native-image-msvc: test-native-image-msvc:
name: native-image on windows-latest name: native-image on windows-latest
@ -151,9 +151,9 @@ jobs:
- name: Build HelloWorld executable with GraalVM Native Image on Windows - name: Build HelloWorld executable with GraalVM Native Image on Windows
run: | run: |
echo 'public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }' > HelloWorld.java echo 'public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }' > HelloWorld.java
javac.exe HelloWorld.java javac HelloWorld.java
native-image.cmd HelloWorld native-image HelloWorld
./helloworld.exe ./helloworld
test-native-image-musl: test-native-image-musl:
name: native-image-musl on ubuntu-latest name: native-image-musl on ubuntu-latest
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -52,7 +52,7 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
version: [latest, dev, '22.0.0.2'] version: ['22.0.0.2', latest]
os: [macos-latest, windows-latest, ubuntu-latest] os: [macos-latest, windows-latest, ubuntu-latest]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -66,17 +66,10 @@ jobs:
- name: Build and run HelloWorld.java - name: Build and run HelloWorld.java
run: | run: |
echo 'public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }' > HelloWorld.java
javac HelloWorld.java javac HelloWorld.java
native-image HelloWorld native-image HelloWorld
./helloworld ./helloworld
if: runner.os != 'Windows'
- name: Build and run HelloWorld.java on Windows
run: |
javac.exe HelloWorld.java
native-image.cmd HelloWorld
./helloworld.exe
if: runner.os == 'Windows'
- name: Upload binary - name: Upload binary
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2