-
Notifications
You must be signed in to change notification settings - Fork 7
134 lines (129 loc) · 3.82 KB
/
main.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: tests
on:
pull_request:
push:
# schedule:
# - cron: '0 0 * * 1'
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
nimversion:
- binary:1.6.12
# - devel
os:
- ubuntu-20.04
- macOS-latest
- windows-latest
steps:
- shell: bash
run: env | sort
- uses: actions/checkout@v1
- uses: iffy/install-nim@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: ${{ matrix.nimversion }}
- name: Cache multiple paths
uses: actions/cache@v2
with:
path: |
~/.nimble/pkgs
key: ${{ runner.os }}-nimble-${{ hashFiles('wiish.nimble') }}
- name: Install
shell: bash
run: |
nimble install -y --verbose
wiish init /tmp/foo
- name: Doctor (Pre)
shell: bash
run: |
wiish doctor || true
- name: Install deps
shell: bash
run: |
if [ "$(uname)" == "Darwin" ]; then
brew install sdl2 sdl2_ttf sdl2_image sdl2_gfx
elif [ "$(uname)" == "Linux" ]; then
sudo apt-get update -q
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev
sudo apt-get install -y libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-gfx-dev
sudo apt install -y xvfb
else
echo "Nothing yet for Windows"
fi
- name: Install Android Device
if: runner.os == 'macOS'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
ndk: 21.0.6113669
cmake: 3.10.2.4988404
script: env | sort
- name: Initialize iOS Device
if: runner.os == 'macOS'
run: |
set -x
xcrun simctl list devices 'iphone 11' --json
nim c .github/ios_devices.nim
SIM_UDID=$(.github/ios_devices | head -n 1)
echo $SIM_UDID
open -a /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app --args -CurrentDeviceUDID $SIM_UDID
- name: Test
shell: bash
timeout-minutes: 60
run: |
set -x
export ANDROID_NDK_HOME="${ANDROID_SDK_ROOT}/ndk-bundle"
export PATH="${ANDROID_NDK_HOME}:${PATH}"
export PATH="${ANDROID_SDK_ROOT}/emulator:${PATH}"
export PATH="${ANDROID_SDK_ROOT}/platform-tools:${PATH}"
if [ "$(uname)" == "Darwin" ]; then
echo "macOS"
export WIISH_BUILD_ANDROID=yes
export WIISH_RUN_ANDROID=yes
export WIISH_TEST_RUN=yes
elif [ "$(uname)" == "Linux" ]; then
echo "Linux"
export WIISH_BUILD_ANDROID=yes
export WIISH_TEST_RUN=yes
else
echo "Windows"
# export WIISH_TEST_RUN=yes
fi
export VERBOSE=1
wiish doctor || true
if [ "$(uname)" == "Linux" ]; then
# Maybe this?
# https://github.saobby.my.eu.orgmunity/t/cant-run-sdl2-no-available-video-device/17190/2
xvfb-run nimble test
else
nimble test
fi
- name: Docs
if: runner.os == 'Linux'
run: |
./builddocs.sh
# Saving for later in case we do Android testing on Windows
# nim c .github/tounixpath.nim
# normpath() {
# varname="$1"
# if [ ! -z "${!varname}" ]; then
# export "${1}"="$(.github/tounixpath "${!varname}")"
# fi
# }
# env | grep -i android
# normpath ANDROID_HOME
# normpath ANDROID_NDK_HOME
# normpath ANDROID_NDK_PATH
# normpath ANDROID_SDK_ROOT
# export PATH="${ANDROID_NDK_HOME}:${PATH}"
# export PATH="${ANDROID_SDK_ROOT}/emulator:${PATH}"
# export PATH="${ANDROID_SDK_ROOT}/platform-tools:${PATH}"
# echo "--------------------- build-local.mk"
# cat "C:\Program Files (x86)\Android\android-sdk\ndk-bundle\build\\..\build\core\build-local.mk"
# echo "---------------------"
# env | grep -i android
# echo $PATH