forked from ebarlas/game-of-life-csp
-
Notifications
You must be signed in to change notification settings - Fork 12
41 lines (37 loc) · 1.36 KB
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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/*