-
Notifications
You must be signed in to change notification settings - Fork 574
166 lines (147 loc) · 4.73 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
163
164
165
166
name: E2E Tests
on:
pull_request:
branches:
- '**'
jobs:
setup:
if: 'false'
runs-on: ubuntu-latest
timeout-minutes: 30
outputs:
plugins: ${{ steps.e2e-packages.outputs.e2e-paths }}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@ce177499ccf9fd2aded3b0426c97e5434c2e8a73
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
- name: Restore Dependency Cache
id: cache-modules
uses: actions/cache@v2
with:
path: |
node_modules
*/node_modules
key: dependency-cache-${{ hashFiles('package.json', '*/package.json') }}
- run: npm install
- id: files
uses: imhoffd/get-changed-files@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-11
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@v2
- name: Setup NodeJS & NPM
uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Prepare Local Package
run: npm 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: Prepare Local Package
run: npm run e2e:prepare
env:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Install Packages
run: npm 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@v2
- name: Setup NodeJS & NPM
uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Prepare Local Package
run: npm run e2e:prepare
env:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Prepare Local Package
run: npm 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: npm install
env:
NPM_TOKEN: ${{ secrets.E2E_NPM_TOKEN }}
- name: AVD cache
uses: actions/cache@v2
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@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@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 }}