Skip to content

Commit

Permalink
refactor: start using setup-graal
Browse files Browse the repository at this point in the history
  • Loading branch information
ckipp01 committed Jul 19, 2023
1 parent e8bfe1d commit ec7c920
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 21 deletions.
48 changes: 28 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI
on:
push:
branches:
- master
- main
pull_request:

jobs:
native-image:
name: Compile
Expand All @@ -13,33 +13,41 @@ jobs:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
java: [11]
java: ['17.0.7']

steps:
- uses: actions/checkout@v3
- uses: olafurpg/setup-scala@v13
- uses: graalvm/setup-graalvm@v1
with:
java-version: "adopt@1.${{ matrix.java }}"
- name: Setup Windows C++ toolchain
uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.os == 'windows-latest' }}
java-version: ${{ matrix.java }}
cache: sbt
components: native-image

- name: sbt test plugin/scripted
if: ${{ matrix.os == 'ubuntu-latest' }}
shell: bash
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
env:
NATIVE_IMAGE_COMMAND: native-image
run: |
export JABBA=/home/runner/bin/jabba
$JABBA install [email protected]
export GRAALVM_HOME=$($JABBA which --home [email protected])
$GRAALVM_HOME/bin/gu install native-image
export NATIVE_IMAGE_COMMAND=$GRAALVM_HOME/bin/native-image
# Copied from https://github.com/graalvm/setup-graalvm#quickstart-template
echo "GRAALVM_HOME: $GRAALVM_HOME"
echo "JAVA_HOME: $JAVA_HOME"
java --version
native-image --version
sbt test plugin/scripted
- name: sbt test
shell: bash
if: ${{ matrix.os == 'windows-latest' }}
run: |
sbt example/nativeImage
# - name: sbt test
# shell: bash
# if: ${{ matrix.os == 'windows-latest' }}
# run: |
# sbt example/nativeImage

check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: olafurpg/setup-scala@v13
- uses: actions/setup-java@v3
- run: sbt checkAll
with:
distribution: 'temurin'
java-version: '17'
cache: 'sbt'
8 changes: 7 additions & 1 deletion .github/workflows/native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Native Image
on:
push:
branches:
- master
- main
pull_request:
release:
types: [published]

jobs:
native-image:
runs-on: ${{ matrix.os }}
Expand All @@ -29,6 +29,7 @@ jobs:
# define Java options for both official sbt and sbt-extras
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8

steps:
- uses: actions/checkout@v3
- name: Setup JDK
Expand All @@ -37,19 +38,24 @@ jobs:
distribution: temurin
java-version: 8
cache: sbt

- run: git fetch --tags || true

- name: Setup Windows C++ toolchain
uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.os == 'windows-latest' }}

- name: Build
shell: bash
run: |
echo $(pwd)
sbt clean example/nativeImage
- uses: actions/upload-artifact@v2
with:
path: ${{ matrix.local_path }}
name: ${{ matrix.uploaded_filename }}

- name: Upload release
if: github.event_name == 'release'
uses: actions/[email protected]
Expand Down

0 comments on commit ec7c920

Please sign in to comment.