-
Notifications
You must be signed in to change notification settings - Fork 2
173 lines (155 loc) · 4.05 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
167
168
169
170
171
172
173
name: Browser Tests
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
###
# Wait for Netlify Deploy Preview to build and deploy
###
netlify:
runs-on: ubuntu-16.04
timeout-minutes: 10
outputs:
url: ${{ steps.netlify.outputs.url }}
steps:
- uses: probablyup/wait-for-netlify-action@3.2.0
id: netlify
with:
site_id: "844b606a-25da-425c-9eb4-f2f362f9a9bc"
max_timeout: 300
env:
NETLIFY_TOKEN: ${{secrets.NETLIFY_TOKEN}}
###
# Cypress Chrome tests
###
cypress-chrome:
runs-on: ubuntu-16.04
timeout-minutes: 15
needs: netlify
container:
image: cypress/browsers:node12.14.1-chrome83-ff77
steps:
- name: Checkout
uses: actions/checkout@v2
# Run all Cypress tests
- name: Tests on Chrome
uses: cypress-io/github-action@v2
with:
# Substitute Netlify Deploy Preview URL to test
config: baseUrl=${{ needs.netlify.outputs.url }}
browser: chrome
working-directory: e2e
# Upload artifacts
- uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-chrome-screenshots
path: e2e/cypress/screenshots
- uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-chrome-videos
path: e2e/cypress/videos
###
# Cypress Microsoft Edge tests
###
cypress-edge:
runs-on: windows-latest
timeout-minutes: 20
needs: netlify
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: cypress-io/github-action@v2
with:
config: baseUrl=${{ needs.netlify.outputs.url }}
browser: edge
working-directory: e2e
- uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-edge-screenshots
path: e2e/cypress/screenshots
- uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-edge-videos
path: e2e/cypress/videos
###
# Cypress Firefox tests
###
cypress-firefox:
runs-on: ubuntu-16.04
timeout-minutes: 15
needs: netlify
container:
image: cypress/browsers:node12.14.1-chrome83-ff77
options: --user 1001 --shm-size=2g
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: cypress-io/github-action@v2
with:
config: baseUrl=${{ needs.netlify.outputs.url }}
browser: firefox
working-directory: e2e
- uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-firefox-screenshots
path: e2e/cypress/screenshots
- uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-firefox-videos
path: e2e/cypress/videos
###
# WebdriverIO Chrome tests
###
wdio-chrome:
runs-on: ubuntu-latest
needs: netlify
container:
image: ianwalter/puppeteer:v4.0.0
timeout-minutes: 10
defaults:
run:
working-directory: e2e
steps:
- uses: actions/checkout@v2
- run: npm ci
- run: npm run wdio
env:
WDIO_BASE_URL: ${{ needs.netlify.outputs.url }}
- uses: actions/upload-artifact@v1
if: failure()
with:
name: wdio-logs
path: e2e/wdio/logs
- uses: actions/upload-artifact@v1
if: failure()
with:
name: wdio-screenshots
path: e2e/wdio/screenshots
###
# WebdriverIO BrowserStack tests
##
wdio-browserstack:
runs-on: ubuntu-latest
needs: netlify
container:
image: ianwalter/puppeteer:v4.0.0
timeout-minutes: 10
defaults:
run:
working-directory: e2e
steps:
- uses: actions/checkout@v2
- run: npm ci
- run: npm run wdio:bs
env:
WDIO_BASE_URL: ${{ needs.netlify.outputs.url }}
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}