-
Notifications
You must be signed in to change notification settings - Fork 0
162 lines (142 loc) · 4.99 KB
/
e2e.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
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: E2E Tests
on:
pull_request:
branches:
- '**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
setup:
if: 'false'
runs-on: ubuntu-latest
timeout-minutes: 30
outputs:
plugins: ${{ steps.e2e-packages.outputs.e2e-paths }}
steps:
- uses: dtinth/setup-github-actions-caching-for-turbo@cc723b4600e40a6b8815b65701d8614b91e2669e # v1
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
with:
node-version-file: .tool-versions
cache: yarn
- run: yarn install
- id: files
uses: imhoffd/get-changed-files@4064453b1b00f8f8d17f1493c90fbe1f9c40daff # v2
with:
format: json
- id: packages
uses: ./.github/actions/changed-packages
with:
files: ${{ steps.files.outputs.all }}
- id: e2e-packages
uses: ./.github/actions/filter-out-non-e2e-enabled
with:
paths: ${{ steps.packages.outputs.paths }}
e2e-ios:
runs-on: macos-14
timeout-minutes: 35
if: needs.setup.outputs.plugins != '[]'
needs:
- setup
strategy:
matrix:
plugin: ${{ fromJson(needs.setup.outputs.plugins) }}
defaults:
run:
working-directory: ${{ matrix.plugin }}/e2e-tests
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
with:
node-version-file: .tool-versions
cache: yarn
- name: Prepare Local Package
run: yarn install && yarn run build && npm run pack-local
working-directory: ${{ matrix.plugin }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Setup NPMRC
run: echo "//registry.npmjs.org/:_authToken=${{secrets.E2E_NPM_TOKEN}}" > .npmrc
- name: Prepare Local Package
run: npm run e2e:prepare
env:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Install Packages
run: yarn install
env:
NPM_TOKEN: ${{ secrets.E2E_NPM_TOKEN }}
- name: Run E2E Test on iOS
run: npm run e2e:ios
env:
REACT_APP_GOOGLE_MAPS_API_KEY: ${{ secrets.REACT_APP_GOOGLE_MAPS_API_KEY }}
e2e-android:
runs-on: macos-10.15
timeout-minutes: 35
if: needs.setup.outputs.plugins != '[]'
needs:
- setup
strategy:
matrix:
plugin: ${{ fromJson(needs.setup.outputs.plugins) }}
defaults:
run:
working-directory: ${{ matrix.plugin }}/e2e-tests
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
with:
node-version-file: .tool-versions
cache: yarn
- name: Prepare Local Package
run: npm run e2e:prepare
env:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Prepare Local Package
run: yarn install && npm run build && npm run pack-local
working-directory: ${{ matrix.plugin }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Setup NPMRC
run: echo "//registry.npmjs.org/:_authToken=${{secrets.E2E_NPM_TOKEN}}" > .npmrc
- name: Setup local.properties
run: echo "REACT_APP_GOOGLE_MAPS_API_KEY=${{secrets.REACT_APP_GOOGLE_MAPS_API_KEY}}" > android/local.properties
- name: Install Packages
run: yarn install
env:
NPM_TOKEN: ${{ secrets.E2E_NPM_TOKEN }}
- name: AVD cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-adb-p3a-30-cache-2
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@f0d1ed2dcad93c7479e8b2f2226c83af54494915 # v2
with:
avd-name: e2eDevice
api-level: 30
target: google_apis
arch: x86
profile: pixel_3a
emulator-build: 7759208
force-avd-creation: true
emulator-options: -no-window -no-audio -no-boot-anim -accel on
script: echo "Generated AVD snapshot for caching."
- name: Run E2E Test on Android
uses: reactivecircus/android-emulator-runner@f0d1ed2dcad93c7479e8b2f2226c83af54494915 # v2
with:
avd-name: e2eDevice
api-level: 30
target: google_apis
arch: x86
profile: pixel_3a
working-directory: ${{ matrix.plugin }}/e2e-tests
emulator-build: 7759208
emulator-options: -no-window -no-audio -no-boot-anim -accel on -no-snapshot-save
disable-animations: false
script: npm run e2e:android
env:
REACT_APP_GOOGLE_MAPS_API_KEY: ${{ secrets.REACT_APP_GOOGLE_MAPS_API_KEY }}