68 lines (56 loc) · 2.05 KB
/
detox-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
name: Detox Integration Tests - Android
on: [push]
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1
# Sharp CLI enables faster image generation during prebuild
# https://github.com/expo/expo-cli/issues/2676
- name: Install Sharp CLI for faster image generation during prebuild
run: yarn global add sharp-cli
- name: Setup Expo
uses: expo/expo-github-action@v7
with:
expo-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Prepare files for gradlew command
run: expo prebuild --platform android
# Bug in gradle 6.9 causing following error:
#
# com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
# > Task :app:mergeExtDexRelease FAILED
# Type androidx.appcompat.app.ActionBar$DisplayOptions is defined multiple times
#
# https://github.com/gradle/gradle/issues/15536
# https://github.com/gradle/gradle/issues/19372
- run: sed -i'' -e 's/gradle-6.9-all.zip/gradle-6.9.2-all.zip/g' android/gradle/wrapper/gradle-wrapper.properties
- name: Install Java JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
- name: Build Android app locally with gradlew
run: yarn detox build --configuration android
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 30
target: default
arch: x86_64
profile: pixel
avd-name: Pixel_3a_API_30
script: yarn detox test --configuration android
# Store any Detox screenshots on test failure
- uses: actions/upload-artifact@v3
if: failure()
with:
name: detox-artifacts
path: .detoxArtifacts