Upgrade Build a Java Module into a Native Executable Demo. #85
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: native-hello-module | |
on: | |
push: | |
paths: | |
- 'native-hello-module/**' | |
- '.github/workflows/native-hello-module.yml' | |
pull_request: | |
paths: | |
- 'native-hello-module/**' | |
- '.github/workflows/native-hello-module.yml' | |
schedule: | |
- cron: "0 0 1 * *" # run every month | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
run: | |
name: Run 'native-hello-module' | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
strategy: | |
matrix: | |
java-version: ['21', 'dev'] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: ${{ matrix.java-version }} | |
distribution: 'graalvm' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
cache: 'maven' | |
native-image-job-reports: 'true' | |
- name: Run 'native-hello-module' | |
run: | | |
cd native-hello-module | |
mvn --no-transfer-progress package | |
native-image --module-path target/HelloModule-1.0-SNAPSHOT.jar --module HelloModule | |
./hellomodule |