-
-
Notifications
You must be signed in to change notification settings - Fork 18
260 lines (213 loc) · 7.9 KB
/
ci.yaml
File metadata and controls
260 lines (213 loc) · 7.9 KB
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "24"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
fastlane-validate:
name: Fastlane Metadata
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Validate
uses: ashutoshgngwr/validate-fastlane-supply-metadata@c8857fdbbd3e00f9a5cbe8604bcecfa95ce8fef8 # v2.1.0
with:
usePlayStoreLocales: true
ios-detox:
name: "iOS Detox (build + test)"
runs-on: depot-macos-15
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Xcode 26.0
run: |
sudo xcode-select -s /Applications/Xcode_26.0.app/Contents/Developer
xcodebuild -version
sudo xcodebuild -runFirstLaunch
xcrun simctl list runtimes
if ! xcrun simctl list runtimes | grep -q "iOS"; then
sudo xcodebuild -downloadPlatform iOS
fi
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "24"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Setup Expo
run: npx expo install
- name: Prebuild iOS
run: npx expo prebuild --platform ios --clean
- name: Build Detox framework cache
run: npx detox build-framework-cache
- name: Build
run: npx detox build --configuration ios.sim.release
- name: Install applesimutils
run: brew tap wix/brew && brew install applesimutils
- name: Setup evcc daemon
run: |
brew tap evcc-io/tap
brew update
brew install evcc
sudo evcc --disable-auth &
- name: Setup Caddy
env:
CADDY_VERSION: 2.11.2
CADDY_SHA256: 7ab765777e953574d5713a69cab3f5a2f643a5c1cc264d4239a60ff845b465d8
run: |
curl -fsSL -o caddy.tar.gz "https://github.com/caddyserver/caddy/releases/download/v${CADDY_VERSION}/caddy_${CADDY_VERSION}_mac_arm64.tar.gz"
echo "${CADDY_SHA256} caddy.tar.gz" | shasum -a 256 -c -
tar -xzf caddy.tar.gz caddy
chmod +x caddy
./caddy run &
- name: Test
run: npx detox test --configuration ios.sim.release --cleanup --headless
- name: Upload artifacts on failure
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ios-detox-artifacts
path: e2e/artifacts/
retention-days: 7
android-build:
name: "Android Detox (build)"
runs-on: depot-ubuntu-24.04-32
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "24"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Setup Expo
run: npx expo install
- name: Prebuild Android
run: npx expo prebuild --platform android --clean
- name: Setup Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: "temurin"
java-version: "17"
- name: Gradle cache
uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0
- name: Build
run: npx detox build --configuration android.emu.release
- name: Upload app apk
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: app-release.apk
path: android/app/build/outputs/apk/release/app-release.apk
if-no-files-found: error
retention-days: 7
- name: Upload detox apk
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: app-release-androidTest.apk
path: android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk
if-no-files-found: error
retention-days: 7
android-test:
name: "Android Detox (test)"
runs-on: ubuntu-latest
timeout-minutes: 30
needs: android-build
strategy:
matrix:
api-level: [34]
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "24"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Setup Expo
run: npx expo install
- name: Prebuild Android
run: npx expo prebuild --platform android --clean
- name: Download app apk
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: app-release.apk
path: android/app/build/outputs/apk/release
- name: Download detox apk
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: app-release-androidTest.apk
path: android/app/build/outputs/apk/androidTest/release
- name: Install system dependencies for android emulator
run: |
sudo apt-get update
sudo apt-get install -y libpulse0
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Setup evcc daemon
run: |
curl -1sLf 'https://dl.evcc.io/public/evcc/stable/setup.deb.sh' | sudo -E bash
sudo apt update
sudo apt install -y evcc
sudo systemctl stop evcc
sudo evcc --disable-auth --database /var/lib/evcc/evcc.db &
- name: Setup Caddy
env:
CADDY_VERSION: 2.11.2
CADDY_SHA256: 94391dfefe1f278ac8f387ab86162f0e88d87ff97df367f360e51e3cda3df56f
run: |
curl -fsSL -o caddy.tar.gz "https://github.com/caddyserver/caddy/releases/download/v${CADDY_VERSION}/caddy_${CADDY_VERSION}_linux_amd64.tar.gz"
echo "${CADDY_SHA256} caddy.tar.gz" | sha256sum -c -
tar -xzf caddy.tar.gz caddy
chmod +x caddy
./caddy run &
- name: Test
uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a # v2.37.0
with:
api-level: ${{ matrix.api-level }}
disk-size: 1G
heap-size: 1G
force-avd-creation: false
target: google_apis
arch: x86_64
disable-animations: true
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: npx detox test --configuration android.emu.release --cleanup --headless
- name: Upload artifacts on failure
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: android-detox-artifacts-api-level-${{ matrix.api-level }}
path: e2e/artifacts/
retention-days: 7