add building native image to workflow #28
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: GraalVM Native Image builds | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: Native image on ubuntu-latest | |
runs-on: windows-latest | |
defaults: | |
run: | |
working-directory: ./game-of-life-native | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jessiscript/setup-graalvm@main | |
with: | |
java-version: '21' | |
distribution: 'graalvm' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
native-image-job-reports: 'true' | |
native-image-pr-comparison: 'true' | |
native-image-pr-comparison-parameter: 'analysis results, resource usage' | |
- name: Get versions | |
run: | | |
echo "GRAALVM_HOME: $GRAALVM_HOME" | |
echo "JAVA_HOME: $JAVA_HOME" | |
java --version | |
native-image --version | |
- name: Build and run game of life | |
run: mvn -Pnative package | |
- name: Build native image | |
run: native-image -cp target\game-of-life.exe gameoflife.Main | |
- name: Upload binary | |
uses: actions/upload-artifact@v2 | |
with: | |
name: nativeImage-ubuntu-latest | |
path: target/*.jar |