-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (67 loc) · 1.85 KB
/
mobile-android-tests.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
name: Mobile Android Tests
on:
push:
branches: [main, master]
paths:
- mobile/**
pull_request:
branches: [master]
paths:
- mobile/**
workflow_dispatch:
env:
ANDROID_EMU_NAME: Pixel_7_API_34_x86
jobs:
build:
name: Android Test
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
working-directory: ./mobile
steps:
- uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 18
- uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
cache: "gradle"
- name: Install dependencies
run: npm ci
- name: Cache Detox build
id: cache-detox-build
uses: actions/cache@v4
with:
path: android/app/build
key: ${{ runner.os }}-detox-build
restore-keys: |
${{ runner.os }}-detox-build
- name: Run Detox Build
run: |
chmod +x android/gradlew
npx detox build --configuration android.emu.debug
- name: Enable KVM group perms
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: Run Detox Test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
arch: x86_64
avd-name: ${{ env.ANDROID_EMU_NAME }}
target: playstore
working-directory: ./mobile
script: ./android-test.sh
disk-size: 4G
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: test-results
path: ./mobile/artifacts/