-
Notifications
You must be signed in to change notification settings - Fork 2
81 lines (79 loc) · 2.97 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
name: e2e tests Android
on: [push]
jobs:
test-android:
name: e2e-android-test
runs-on: macos-latest
steps:
- name: checkout
uses: actions/checkout@v3
# build opaque_rust lib
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r23b
- name: Add iOS targets
working-directory: rust
run: rustup target add x86_64-apple-ios aarch64-apple-ios aarch64-apple-ios-sim
- name: Add Android targets
working-directory: rust
run: rustup target add i686-linux-android x86_64-linux-android aarch64-linux-android arm-linux-androideabi
- name: Install cxxbridge
working-directory: rust
run: cargo install cxxbridge-cmd
- name: build
working-directory: rust
run: ./build-all.sh
env:
NDK: ${{ steps.setup-ndk.outputs.ndk-path }}
# build app
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Setup Java environment
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- name: Gradle cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}
- name: Install node_modules in root
run: yarn install --frozen-lockfile
- name: Install node_modules in example
working-directory: example
run: yarn install --frozen-lockfile
# Install Maestro
- name: Install Maestro CLI
run: curl -Ls "https://get.maestro.mobile.dev" | bash
- name: Add Maestro to path
run: echo "${HOME}/.maestro/bin" >> $GITHUB_PATH
# Run emulator and e2e tests
- name: Run Android Emulator and app
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
arch: x86_64
target: google_apis
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
working-directory: example
# For some reason in `script` we can't run scripts with multiple
# arguments and therefor we created the yarn scripts.
# Noticed this workaround in: https://github.com/stripe/stripe-react-native/blob/master/.github/workflows/e2e-tests.yml#L71
script: |
yarn android-release
yarn e2e-debug
yarn android-e2e-tests