Skip to content

Commit 30247d9

Browse files
committed
Fix GitHub Actions
This fixes GitHub Actions to it builds native image. 1. Use ilammy/msvc-dev-cmd to setup C++ toolchain on Windows. 2. Downgrade to windows-2019, instead of windows-latest 3. Use `setup-java@v3` 4. Use `actions/checkout@v3` 5. Call clean on sbt 6. Fix a typo that was saying "unix" before
1 parent 9cee2c1 commit 30247d9

File tree

3 files changed

+33
-27
lines changed

3 files changed

+33
-27
lines changed

.github/workflows/ci.yml

+11-10
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,22 @@ on:
66
- main
77
pull_request:
88
jobs:
9-
unix:
9+
native-image:
1010
name: Compile
1111
runs-on: ${{ matrix.os }}
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
os: [macOS-latest, ubuntu-latest, windows-latest]
15+
os: [macOS-latest, ubuntu-latest, windows-2019]
1616
java: [8]
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919
- uses: olafurpg/setup-scala@v13
2020
with:
2121
java-version: "adopt@1.${{ matrix.java }}"
22+
- name: Setup Windows C++ toolchain
23+
uses: ilammy/msvc-dev-cmd@v1
24+
if: ${{ matrix.os == 'windows-2019' }}
2225
- name: sbt test plugin/scripted
2326
if: ${{ matrix.os == 'ubuntu-latest' }}
2427
shell: bash
@@ -30,15 +33,13 @@ jobs:
3033
export NATIVE_IMAGE_COMMAND=$GRAALVM_HOME/bin/native-image
3134
sbt test plugin/scripted
3235
- name: sbt test
33-
shell: cmd
34-
if: ${{ matrix.os == 'windows-latest' }}
35-
run: >-
36-
"C:\Program Files (x86)\Microsoft Visual
37-
Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" && sbt
38-
example/nativeImage
36+
shell: bash
37+
if: ${{ matrix.os == 'windows-2019' }}
38+
run: |
39+
sbt example/nativeImage
3940
check:
4041
runs-on: ubuntu-latest
4142
steps:
42-
- uses: actions/checkout@v2
43+
- uses: actions/checkout@v3
4344
- uses: olafurpg/setup-scala@v13
4445
- run: sbt checkAll

.github/workflows/native.yml

+21-16
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ on:
88
release:
99
types: [published]
1010
jobs:
11-
unix:
11+
native-image:
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
os: [macOS-latest, ubuntu-latest, windows-latest]
16+
os: [macOS-latest, ubuntu-latest, windows-2019]
1717
include:
1818
# Replace "example" with the name your binary
1919
- os: macOS-latest
@@ -22,25 +22,30 @@ jobs:
2222
- os: ubuntu-latest
2323
uploaded_filename: example-x86_64-pc-linux
2424
local_path: example/target/native-image/example
25-
- os: windows-latest
25+
- os: windows-2019
2626
uploaded_filename: example-x86_64-pc-win32.exe
2727
local_path: example\target\native-image\example.exe
28+
env:
29+
# define Java options for both official sbt and sbt-extras
30+
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
31+
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
2832
steps:
29-
- uses: actions/checkout@v2
30-
- uses: olafurpg/setup-scala@v13
33+
- uses: actions/checkout@v3
34+
- name: Setup JDK
35+
uses: actions/setup-java@v3
36+
with:
37+
distribution: temurin
38+
java-version: 8
39+
cache: sbt
3140
- run: git fetch --tags || true
32-
- run: sbt example/nativeImage
33-
shell: bash
34-
if: ${{ matrix.os != 'windows-latest' }}
35-
- run: echo $(pwd)
41+
- name: Setup Windows C++ toolchain
42+
uses: ilammy/msvc-dev-cmd@v1
43+
if: ${{ matrix.os == 'windows-2019' }}
44+
- name: Build
3645
shell: bash
37-
- name: sbt test
38-
shell: cmd
39-
if: ${{ matrix.os == 'windows-latest' }}
40-
run: >-
41-
"C:\Program Files (x86)\Microsoft Visual
42-
Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" && sbt
43-
example/nativeImage
46+
run: |
47+
echo $(pwd)
48+
sbt clean example/nativeImage
4449
- uses: actions/upload-artifact@v2
4550
with:
4651
path: ${{ matrix.local_path }}

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
publish:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v3
1010
- uses: olafurpg/setup-scala@v13
1111
- uses: olafurpg/setup-gpg@v3
1212
- run: git fetch --tags || true

0 commit comments

Comments
 (0)