Skip to content

Commit 29a984a

Browse files
authored
Run CI on Windows (#351)
1 parent 9d5fdb3 commit 29a984a

File tree

2 files changed

+35
-10
lines changed

2 files changed

+35
-10
lines changed

.github/workflows/build.yml

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ on:
1010

1111
jobs:
1212
build:
13-
14-
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
os:
16+
- ubuntu-20.04
17+
# macos-10.15
18+
- windows-2022
19+
runs-on: ${{ matrix.os }}
1520
# defaults:
1621
# run:
1722
# shell: bash
@@ -26,30 +31,43 @@ jobs:
2631
with:
2732
java-version: 11
2833

34+
- name: Install dependencies for ${{ runner.os }}
35+
shell: bash
36+
run: |
37+
if [ "$RUNNER_OS" == "Windows" ]; then
38+
choco install zip
39+
# Overwrite the WSL bash.exe
40+
cp /c/msys64/usr/bin/bash.exe /c/Windows/System32/bash.exe
41+
fi
42+
2943
# - name: Update system dependencies
3044
# run: |
3145
# sudo apt-get update
3246
# sudo apt-get install -y curl unzip zip wget
3347

3448
- name: Install sdkman
49+
shell: bash
3550
run: |
3651
bash -c "curl -s "https://get.sdkman.io" | bash"
37-
source "/home/runner/.sdkman/bin/sdkman-init.sh"
52+
source "$HOME/.sdkman/bin/sdkman-init.sh"
3853
3954
- name: Install kotlin
55+
shell: bash
4056
run: |
41-
source "/home/runner/.sdkman/bin/sdkman-init.sh"
57+
source "$HOME/.sdkman/bin/sdkman-init.sh"
4258
sdk install kotlin 1.4.31
4359
4460
- name: Install gradle
61+
shell: bash
4562
run: |
46-
source "/home/runner/.sdkman/bin/sdkman-init.sh"
63+
source "$HOME/.sdkman/bin/sdkman-init.sh"
4764
sdk install gradle 6.7
4865
4966
5067
# https://stackoverflow.com/questions/50104666/gradle-difference-between-test-and-check
5168
- name: Build and test with Gradle
5269
# working-directory: $GITHUB_WORKSPACE
70+
shell: bash
5371
run: |
5472
echo $GITHUB_WORKSPACE
5573
chmod +x gradlew
@@ -60,29 +78,36 @@ jobs:
6078
run: ./gradlew assemble
6179

6280
- name: Install assert.sh
81+
shell: bash
6382
run: |
64-
wget https://raw.github.com/lehmannro/assert.sh/v1.1/assert.sh
83+
curl -sLO https://raw.github.com/lehmannro/assert.sh/v1.1/assert.sh
6584
chmod +x assert.sh
6685
6786
# https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
68-
- name: Update PATH to include kscrript
87+
- name: Update PATH to include kscript
88+
shell: bash
6989
run: echo "${GITHUB_WORKSPACE}/build/libs" >> $GITHUB_PATH
7090

7191
- run: which kscript
92+
shell: bash
7293

7394
- name: Print --version
95+
shell: bash
7496
run: |
75-
source "/home/runner/.sdkman/bin/sdkman-init.sh"
97+
source "$HOME/.sdkman/bin/sdkman-init.sh"
7698
kscript --version
7799
78100
- name: Create mock idea executable
101+
shell: bash
79102
run: |
80103
touch idea
81104
chmod +x idea
82105
echo "${PWD}" >> $GITHUB_PATH
83106
84107
- name: Run tests
108+
shell: bash
109+
if: ${{ runner.os != 'Windows' }}
85110
run: |
86-
source "/home/runner/.sdkman/bin/sdkman-init.sh"
111+
source "$HOME/.sdkman/bin/sdkman-init.sh"
87112
export KSCRIPT_HOME="$GITHUB_WORKSPACE"
88113
./test/test_suite.sh

test/setup_environment.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ echo "KScript path for testing: $(which kscript)"
2323

2424
if [[ ! -f "$KSCRIPT_EXEC_DIR/assert.sh" ]]; then
2525
echo "Installing assert.sh"
26-
wget --quiet -O "$KSCRIPT_EXEC_DIR/assert.sh" https://raw.githubusercontent.com/lehmannro/assert.sh/master/assert.sh
26+
curl --silent --show-error -L -o "$KSCRIPT_EXEC_DIR/assert.sh" https://raw.githubusercontent.com/lehmannro/assert.sh/master/assert.sh
2727
chmod u+x "$KSCRIPT_EXEC_DIR/assert.sh"
2828
fi
2929

0 commit comments

Comments
 (0)