-
Notifications
You must be signed in to change notification settings - Fork 31
161 lines (141 loc) · 4.31 KB
/
pr.yaml
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: PR checks
on:
workflow_dispatch:
pull_request:
jobs:
setup:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
node_modules
example/ios/Pods
example/ios/build
example/node_modules
key: ${{ runner.os }}-setup-cache-2
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn bootstrap
lint:
runs-on: macos-latest
needs: setup
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
node_modules
example/ios/Pods
example/ios/build
example/node_modules
key: ${{ runner.os }}-setup-cache-2
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn lint
- run: yarn typescript
test:
runs-on: macos-latest
needs: setup
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
node_modules
example/ios/Pods
example/ios/build
example/node_modules
key: ${{ runner.os }}-setup-cache-2
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn test
ios:
runs-on: macos-latest
needs: [lint, test]
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
node_modules
example/ios/Pods
example/ios/build
example/node_modules
key: ${{ runner.os }}-setup-cache-2
- uses: actions/cache@v3
with:
path: |
example/ios/build
key: ${{ runner.os }}-ios-cache
- name: install detox deps
run: |
brew tap wix/brew
brew install applesimutils
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn e2e:reset
- run: yarn bootstrap
- run: yarn e2e:build:ios:release
- run: yarn e2e:test:ios:release
android:
runs-on: macos-latest
needs: [lint, test]
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
node_modules
example/ios/Pods
example/ios/build
example/node_modules
key: ${{ runner.os }}-setup-cache-2
- uses: actions/cache@v3
with:
path: |
android/build
example/android/build
key: ${{ runner.os }}-android-cache
- name: get device name
id: device
run: node -e "console.log('AVD_NAME=' + require('./.detoxrc').devices.android.device.avdName)" >> $GITHUB_OUTPUT
- name: list possible devices
run: $ANDROID_HOME/tools/bin/avdmanager list
- name: create ${{ steps.device.outputs.AVD_NAME }}
run: |
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install "system-images;android-31;default;x86_64"
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd --force --name "${{ steps.device.outputs.AVD_NAME }}" --device "pixel_xl" -k 'system-images;android-31;default;x86_64'
$ANDROID_HOME/emulator/emulator -list-avds
- name: start android device
timeout-minutes: 10
continue-on-error: true
run: |
echo "starting emulator"
nohup $ANDROID_HOME/emulator/emulator -avd "${{ steps.device.outputs.AVD_NAME }}" -no-snapshot-save -no-window -no-boot-anim -camera-back none &
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82'
$ANDROID_HOME/platform-tools/adb devices
echo "emulator started"
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
cache: gradle
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn e2e:build:android:release
- run: yarn e2e:test:android:release