-
Notifications
You must be signed in to change notification settings - Fork 32
92 lines (78 loc) · 2.86 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
name: E2E - Android
on: push
jobs:
e2e-android:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# tool-cache: true
android: false
- name: Setup
uses: ./.github/actions/setup
- name: Install detox, detox-cli react-native-cli
run: npm install -g detox detox-cli react-native-cli
- name: Setup Java
uses: actions/setup-java@v4
with:
# cache: gradle
distribution: zulu
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
# cache-read-only: false
- name: Example App Yarn install
run: |
cd example
yarn install --immutable
cd ..
# - name: Cache Detox build
# id: cache-detox-build
# uses: actions/cache@v4
# with:
# path: example/android/app/build
# key: ${{ runner.os }}-detox-build
# restore-keys: |
# ${{ runner.os }}-detox-build
- name: Detox build
env:
ITBL_API_KEY: ${{secrets.ITERABLE_API_KEY}}
ITBL_ID: ${{secrets.ITBL_ID}}
CI: true
run: |
cd example
yarn detox build --configuration android.emu.release
cd ..
- 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: Get device name
id: device
run: node -e "console.log('AVD_NAME=' + require('./example/.detoxrc').devices.emulator.device.avdName)" >> $GITHUB_OUTPUT
- name: Detox test
uses: reactivecircus/android-emulator-runner@v2
env:
ITBL_API_KEY: ${{secrets.ITERABLE_API_KEY}}
ITBL_ID: ${{secrets.ITBL_ID}}
CI: true
with:
api-level: 31
arch: x86_64
avd-name: ${{ steps.device.outputs.AVD_NAME }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-metrics
disable-animations: true
script: yarn detox test --configuration android.emu.release --headless --record-logs all --record-videos failing --take-screenshots failing --record-timeline all --capture-view-hierarchy enabled --cleanup --maxWorkers=2 --workers 1 --debug-synchronization 500 -l trace --cleanup --reuse
- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: detox-artifacts
path: example/artifacts