-
Notifications
You must be signed in to change notification settings - Fork 126
109 lines (95 loc) · 3.35 KB
/
build.yml
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: build
on:
workflow_dispatch:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- macos-12
- windows-2022
variant:
- posix
include:
- os: windows-2022
variant: cygwin
- os: windows-2022
variant: cmd
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- name: Setup Kotlin
uses: fwilhe2/setup-kotlin@main
with:
version: 1.7.21
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.4.2
with:
gradle-version: 8.0.2
- name: Install dependencies for ${{ runner.os }}
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
choco install zip
# Overwrite the WSL bash.exe
# cp /c/msys64/usr/bin/bash.exe /c/Windows/System32/bash.exe
mv /c/Windows/System32/bash.exe /c/Windows/System32/wsl-bash.exe
fi
- name: Run tests for Posix (and MSYS on Windows)
if: matrix.variant == 'posix'
shell: bash
run: |
# For Windows this action is running MSYS Os type
echo "OsType: $OSTYPE"
gradle clean assemble test || { echo 'Compilation or Unit tests failed' ; exit 1; }
if [[ "$OSTYPE" == "linux"* ]]; then
echo "Linux test..."
gradle -DosType=$OSTYPE -DincludeTags='posix | linux' integrationTest
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "MacOs test..."
gradle -DosType=$OSTYPE -DincludeTags='posix | macos' integrationTest
elif [[ "$OSTYPE" == "cygwin" ]]; then
echo "Cygwin test..."
gradle -DosType=$OSTYPE -DincludeTags='posix | cygwin' integrationTest
elif [[ "$OSTYPE" == "msys" ]]; then
echo "MSys test..."
gradle -DosType=$OSTYPE -DincludeTags='posix | msys' integrationTest
elif [[ "$OSTYPE" == "freebsd"* ]]; then
echo "FreeBsd test..."
gradle -DosType=$OSTYPE -DincludeTags='posix' integrationTest
else
echo "Unknown OS"
exit 1
fi
- name: Run tests specific for Windows (cmd shell)
if: matrix.variant == 'cmd'
shell: cmd
run: |
echo "Windows test..."
gradle -DosType=windows -DincludeTags="windows" clean assemble test integrationTest
- name: Install Cygwin (only Windows)
if: matrix.variant == 'cygwin'
uses: egor-tensin/setup-cygwin@v3
- name: Run tests specific for Cygwin
if: matrix.variant == 'cygwin'
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
run: |
echo $OSTYPE
echo "Cygwin test..."
echo "Changing directory to $GITHUB_WORKSPACE ..."
cd $GITHUB_WORKSPACE
gradle clean assemble test || { echo 'Compilation or Unit tests failed' ; exit 1; }
gradle -DosType=$OSTYPE -DincludeTags='posix | cygwin' integrationTest