Skip to content

Commit

Permalink
Test building of native executables with graalvm native-image
Browse files Browse the repository at this point in the history
  • Loading branch information
Griefed committed Jul 24, 2024
1 parent 1960ffb commit 28b3de3
Showing 1 changed file with 43 additions and 2 deletions.
45 changes: 43 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4.1.1
- uses: actions/checkout@v4

- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v7.0.7
uses: tj-actions/branch-names@v7

- name: Set up JDK 21
uses: actions/setup-java@v4
Expand Down Expand Up @@ -55,3 +55,44 @@ jobs:
serverpackcreator-web-frontend/dist
serverpackcreator-plugin-example/build
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`

executables:
name: Executable on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v4

- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v7

- uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm-community'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
set-java-home: 'true'

- uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper

- name: Set Permissions
run: |
chmod +x gradlew
- name: Build and run HelloWorld.java
run: |
./gradlew -Pversion="${{ steps.branch-name.outputs.current_branch }}" build --info --full-stacktrace -x :serverpackcreator-api:test -x :serverpackcreator-app:test
cd serverpackcreator-app/build/libs
native-image -jar serverpackcreator-app-${{ steps.branch-name.outputs.current_branch }}.jar -o ServerPackCreator-${{ steps.branch-name.outputs.current_branch }}
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: ServerPackCreator-${{ matrix.os }}
path: serverpackcreator-app/build/libs/ServerPackCreator*

0 comments on commit 28b3de3

Please sign in to comment.