-
Notifications
You must be signed in to change notification settings - Fork 87
97 lines (77 loc) · 2.98 KB
/
e2e-android.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
name: Detox E2E Android
on:
pull_request:
paths:
- packages/mobile/**
- packages/backend/**
- packages/state-manager/**
- .github/workflows/e2e-android.yml
jobs:
detox-android:
timeout-minutes: 25
runs-on: [macos-latest-xlarge]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@master
with:
node-version: 18.12.1
# - name: Install dependencies
# run: |
# npm ci
# npm run lerna bootstrap -- --scope=\'{@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/mobile,backend-bundle}\'
# - name: Pull binaries
# run: |
# git lfs install --force
# git lfs pull
# see: https://stackoverflow.com/questions/67264212/android-emulator-crash-when-start-hvf-error-hv-error
- name:
run: |
{
echo '<?xml version="1.0" encoding="UTF-8"?>'
echo '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">'
echo '<plist version="1.0">'
echo '<dict>'
echo ' <key>com.apple.security.hypervisor</key>'
echo ' <true/>'
echo '</dict>'
echo '</plist>'
} >> $ANDROID_HOME/emulator/qemu/darwin-aarch64/entitlements.xml
- name: Read entitlements
run: cat $ANDROID_HOME/emulator/qemu/darwin-aarch64/entitlements.xml
- name: Resign qemu binary
run: |
cd $ANDROID_HOME/emulator/qemu/darwin-aarch64
codesign -s - --entitlements entitlements.xml --force qemu-system-aarch64 --verbose
- name: Install SDK image
run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'system-images;android-34;google_apis;arm64-v8a'
- name: Create AVD
run: $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n emulator_ci -k 'system-images;android-34;google_apis;arm64-v8a' -d 'pixel_7'
- name: Boot AVD
run: $ANDROID_HOME/emulator/emulator -avd emulator_ci
# - name: Install pm2
# run: npm install pm2@latest -g
# - name: Start metro
# run: |
# cd packages/mobile
# pm2 --name METRO start npm -- start
# - name: Install Detox CLI
# run: npm install detox-cli --global
# - name: Build Detox
# run: |
# cd packages/mobile
# detox build -c android.emu.debug.ci
# - name: Run basic tests
# run: |
# cd packages/mobile
# detox test starter -c android.emu.debug.ci
# - name: Stop metro
# run: pm2 stop METRO
# - name: Take screenshot
# if: always()
# run: | # TODO
# - name: Upload screenshot
# if: always()
# uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
# with:
# name: screenshot.png
# path: screenshot.png