-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (46 loc) · 1.43 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
name: Mobile Android Tests
on:
push:
branches: [main, master]
pull_request:
branches: [master]
env:
ANDROID_ARCH: x86_64
ANDROID_TARGET: google_apis_playstore
API_LEVEL: 34
EMULATOR_NAME: Pixel_7_API_34_x86
ANDROID_SDK_PACKAGES: tools platfrom-tools emulator system-images;android-34;google_apis_playstore;x86_64 platforms;android-34 build-tools;34.0.0
jobs:
build:
name: Android Test
runs-on: macOS-latest
defaults:
run:
working-directory: ./mobile
steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
- name: Setup Android SDK
uses: android-actions/setup-android@v3
with:
packages: "${ANDROID_SDK_PACKAGES}"
- name: Build emulator
run: |
echo "no" | avdmanager --verbose create avd --force -n $EMULATOR_NAME --abi "${ANDROID_TARGET}/${ANDROID_ARCH}" -k "system-images;android-${API_LEVEL};${ANDROID_TARGET};${ANDROID_ARCH}"
- name: Install dependencies
run: npm ci
- name: Run Detox Build
run: |
chmod +x android/gradlew
npx detox build --configuration android.emu.debug
- name: Run Detox Test
run: |
npx expo start &
npx detox test --configuration android.emu.debug