-
Notifications
You must be signed in to change notification settings - Fork 22
148 lines (126 loc) · 4.47 KB
/
e2e-test_old.yaml
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: End-to-end test
on:
workflow_call:
inputs:
timestamp:
required: true
type: string
cache-key:
required: true
type: string
env:
REPO-OWNER: ${{ github.repository_owner }}
jobs:
e2e-test:
name: End-to-end test
runs-on: macos-13
strategy:
matrix:
include:
- arch: x86_64
api-level: 30
env:
CACHE-KEY: ${{ inputs.cache-key }}
continue-on-error: true #temporary while e2e is still flaky
steps:
- name: Set envs for zingolib CI
if: ${{ contains(github.repository, 'zingolib') }}
run: echo "REPO-OWNER=zingolabs" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: ${{ env.REPO-OWNER }}/zingo-mobile
- name: Setup Docker 1 try
uses: douglascamata/setup-docker-macos-action@v1-alpha
id: dockerTry1
continue-on-error: true
with:
lima: v0.18.0
colima: v0.5.6
- name: checking outcome 1
run: echo ${{ steps.dockerTry1.outcome }}
- name: Setup Docker 2 try
if: steps.dockerTry1.outcome != 'success'
uses: douglascamata/setup-docker-macos-action@v1-alpha
id: dockerTry2
continue-on-error: true
with:
lima: v0.18.0
colima: v0.5.6
- name: checking outcome 2
run: echo ${{ steps.dockerTry2.outcome }}
- name: Setup Docker Manually
if: steps.dockerTry1.outcome != 'success' && steps.dockerTry2.outcome != 'success'
run: |
brew uninstall colima
brew tap colima/releases
brew install [email protected]
brew install --formula docker
colima start
- name: Pull regchest docker image
run: docker pull zingodevops/regchest:007
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.2
build-root-directory: ./android
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev'}}
- name: Native rust cache
uses: actions/cache/restore@v4
with:
path: android/app/src/main/jniLibs/${{ matrix.arch }}
key: native-android-uniffi-${{ matrix.arch }}-${{ env.CACHE-KEY }}
fail-on-cache-miss: true
- name: Kotlin uniffi cache
uses: actions/cache/restore@v4
with:
path: android/app/build/generated/source/uniffi/debug/java/uniffi/zingo
key: kotlin-android-uniffi-${{ matrix.arch }}-${{ env.CACHE-KEY }}
fail-on-cache-miss: true
- name: Restore AVD cache
uses: actions/cache/restore@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.arch }}-api-${{ matrix.api-level }}-e2e
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Save AVD cache
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
id: avd-cache-saving
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.arch }}-api-${{ matrix.api-level }}-e2e
-name: Yarn install
run: yarn
- name: Run Detox Build
run: yarn detox build -c android.emu.debug -n test
- name: Yarn Start
run: nohup yarn start > "yarn_react_native_start.out" &
- name: Run Detox Test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: yarn detox test -c android.emu.debug -n test