Skip to content

Commit 101b85e

Browse files
committed
refactor: start using setup-graal
1 parent e8bfe1d commit 101b85e

File tree

2 files changed

+35
-21
lines changed

2 files changed

+35
-21
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22
on:
33
push:
44
branches:
5-
- master
65
- main
76
pull_request:
7+
88
jobs:
99
native-image:
1010
name: Compile
@@ -13,33 +13,41 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
os: [macOS-latest, ubuntu-latest, windows-latest]
16-
java: [11]
16+
java: ['17.0.7']
17+
1718
steps:
1819
- uses: actions/checkout@v3
19-
- uses: olafurpg/setup-scala@v13
20+
- uses: graalvm/setup-graalvm@v1
2021
with:
21-
java-version: "adopt@1.${{ matrix.java }}"
22-
- name: Setup Windows C++ toolchain
23-
uses: ilammy/msvc-dev-cmd@v1
24-
if: ${{ matrix.os == 'windows-latest' }}
22+
java-version: ${{ matrix.java }}
23+
cache: sbt
24+
components: native-image
25+
2526
- name: sbt test plugin/scripted
26-
if: ${{ matrix.os == 'ubuntu-latest' }}
27-
shell: bash
27+
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
28+
env:
29+
NATIVE_IMAGE_COMMAND: native-image
2830
run: |
29-
export JABBA=/home/runner/bin/jabba
30-
$JABBA install graalvm@22.3.0
31-
export GRAALVM_HOME=$($JABBA which --home graalvm@22.3.0)
32-
$GRAALVM_HOME/bin/gu install native-image
33-
export NATIVE_IMAGE_COMMAND=$GRAALVM_HOME/bin/native-image
31+
# Copied from https://github.com/graalvm/setup-graalvm#quickstart-template
32+
echo "GRAALVM_HOME: $GRAALVM_HOME"
33+
echo "JAVA_HOME: $JAVA_HOME"
34+
java --version
35+
native-image --version
3436
sbt test plugin/scripted
35-
- name: sbt test
36-
shell: bash
37-
if: ${{ matrix.os == 'windows-latest' }}
38-
run: |
39-
sbt example/nativeImage
37+
38+
# - name: sbt test
39+
# shell: bash
40+
# if: ${{ matrix.os == 'windows-latest' }}
41+
# run: |
42+
# sbt example/nativeImage
43+
4044
check:
4145
runs-on: ubuntu-latest
4246
steps:
4347
- uses: actions/checkout@v3
44-
- uses: olafurpg/setup-scala@v13
48+
- uses: actions/setup-java@v3
49+
with:
50+
distribution: 'temurin'
51+
java-version: '17'
52+
cache: 'sbt'
4553
- run: sbt checkAll

.github/workflows/native.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: Native Image
22
on:
33
push:
44
branches:
5-
- master
65
- main
76
pull_request:
87
release:
98
types: [published]
9+
1010
jobs:
1111
native-image:
1212
runs-on: ${{ matrix.os }}
@@ -29,6 +29,7 @@ jobs:
2929
# define Java options for both official sbt and sbt-extras
3030
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
3131
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
32+
3233
steps:
3334
- uses: actions/checkout@v3
3435
- name: Setup JDK
@@ -37,19 +38,24 @@ jobs:
3738
distribution: temurin
3839
java-version: 8
3940
cache: sbt
41+
4042
- run: git fetch --tags || true
43+
4144
- name: Setup Windows C++ toolchain
4245
uses: ilammy/msvc-dev-cmd@v1
4346
if: ${{ matrix.os == 'windows-latest' }}
47+
4448
- name: Build
4549
shell: bash
4650
run: |
4751
echo $(pwd)
4852
sbt clean example/nativeImage
53+
4954
- uses: actions/upload-artifact@v2
5055
with:
5156
path: ${{ matrix.local_path }}
5257
name: ${{ matrix.uploaded_filename }}
58+
5359
- name: Upload release
5460
if: github.event_name == 'release'
5561
uses: actions/upload-release-asset@v1.0.2

0 commit comments

Comments
 (0)