-
Notifications
You must be signed in to change notification settings - Fork 1.4k
91 lines (73 loc) · 2.77 KB
/
test-android-detox.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
name: Android E2E Tests
on: [push, pull_request]
jobs:
detox-e2e-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: ci/prepare-node-deps
uses: ./.github/actions/prepare-node-deps
- name: Install Sharp CLI for faster image generation during prebuild
run: npm install --global sharp-cli
- name: Start React Native Metro Server
run: npm run start &
- name: Install Detox Dependencies
run: cd detox && npm i
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- name: Create destination path
run: mkdir -p android/app/build/outputs/apk
- name: Download artifact
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -L -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/mattermost/mattermost-mobile/actions/artifacts/1578521977/zip \
--output android/app/build/outputs/apk/artifact.zip
- name: Unzip artifact
run: unzip android/app/build/outputs/apk/artifact.zip -d android/app/build/outputs/apk
- name: Cleanup
run: rm android/app/build/outputs/apk/artifact.zip
- name: Download and set up Android SDK
uses: android-actions/setup-android@v2
with:
api-level: 30
target: default
arch: x86_64
profile: default
emulator-build: system-images;android-30;default;x86_64
- name: Start Android Emulator
run: |
sudo $ANDROID_HOME/emulator/emulator -avd test -no-audio -no-window &
adb wait-for-device
adb shell input keyevent 82
- name: Run Android Detox E2E Tests on macOS
run: |
cd detox && npm run e2e:android-test -- about.e2e.ts
- name: Upload Android Test Report
if: always()
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: android-results-1
path: detox/artifacts
- name: capture
run: |
screencapture emulator-macos-13.jpg
$ANDROID_HOME/platform-tools/adb exec-out screencap -p > emulator-capture-macos-13.png
- uses: actions/upload-artifact@v3
with:
name: Android-Emulator-Screenshots
path: emulator-macos-13.jpg
- uses: actions/upload-artifact@v3
with:
name: Android-Emulator-Screenshots
path: emulator-capture-macos-13.png
- name: Stop Android Emulator
run: adb -s emulator-5554 emu kill