Upgrade to JDK 21 #19
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: Build with GraalVM Native Image | |
on: [push, workflow_dispatch] | |
env: | |
MX_PYTHON: python3.8 | |
jobs: | |
build: | |
name: ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: '21' | |
distribution: 'graalvm' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
native-image-job-reports: 'true' | |
native-image-pr-reports: 'true' | |
- name: Build native Game of Life | |
run: | | |
if [[ "${RUNNER_OS}" == "Linux" ]]; then mvn_profile="native-ee-g1"; else mvn_profile="native"; fi | |
mvn --no-transfer-progress -P$mvn_profile package | |
cp ./target/game-of-life ./ | |
- name: Run Game of Life demo in JIT vs. AOT modes | |
run: | | |
if [[ "${RUNNER_OS}" == "Linux" ]]; then bench="/usr/bin/time -v"; else bench="time"; fi | |
$bench $JAVA_HOME/bin/java --enable-preview -cp target/classes/ gameoflife.Main patterns/puffer_train.txt 0 10 91 10 91 true true | |
$bench ./game-of-life patterns/puffer_train.txt 0 10 91 10 91 true true | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: game-of-life-${{ matrix.os }} | |
path: | | |
game-of-life | |
patterns/* |