1
1
name : on-pull-request-or-push
2
2
3
3
on :
4
+ workflow_dispatch :
4
5
pull_request :
5
6
push :
6
7
branches :
13
14
MOZ_HEALESS : 1
14
15
SAUCE_USERNAME_PR : valorkinpr
15
16
SAUCE_ACCESS_KEY_PR : e0a97bd3-4b74-4408-89bf-cce1b44a8bf1
16
- CYPRESS_CACHE_FOLDER : ' node_modules/.cypress'
17
- CYPRESS_RECORD_KEY : 4aa7a1c0-3a4f-444e-b324-6fc305a543a8
18
17
FIREBASE_CHANNEL : ${{ fromJSON('["", "live"]')[!github.base_ref] }}
18
+ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD : 0
19
19
20
20
CACHE_NODE_MODULES_PATH : |
21
21
~/.npm
29
29
runs-on : ubuntu-latest
30
30
steps :
31
31
- name : Cancel Previous Runs
32
- uses : styfle/cancel-workflow-action@0.9 .0
32
+ uses : styfle/cancel-workflow-action@0.11 .0
33
33
with :
34
34
access_token : ${{ secrets.GITHUB_TOKEN }}
35
35
38
38
runs-on : ubuntu-latest
39
39
needs : one_run
40
40
steps :
41
- - uses : actions/checkout@v2
42
- - uses : actions/cache@v2
41
+ - uses : actions/checkout@v3
42
+ - uses : actions/cache@v3
43
43
id : cache
44
44
with :
45
45
path : ${{ env.CACHE_NODE_MODULES_PATH }}
@@ -52,35 +52,35 @@ jobs:
52
52
needs : install
53
53
runs-on : ubuntu-latest
54
54
steps :
55
- - uses : actions/checkout@v2
56
- - uses : actions/cache@v2
55
+ - uses : actions/checkout@v3
56
+ - uses : actions/cache@v3
57
57
with :
58
58
path : ${{ env.CACHE_NODE_MODULES_PATH }}
59
59
key : node_modules-${{ hashFiles('**/package-lock.json') }}
60
- - uses : actions/cache@v2
60
+ - uses : actions/cache@v3
61
61
with :
62
62
path : ${{ env.CACHE_DIST_PATH }}
63
63
key : dist-${{ github.run_id }}
64
64
- run : |
65
- npx nx build ngx-bootstrap --runner cloud --configuration production
66
- npx nx build --runner cloud --configuration production
65
+ npx nx build ngx-bootstrap --runner= cloud --configuration= production
66
+ npx nx build --runner= cloud --configuration= production
67
67
68
68
69
69
# run unit tests
70
70
unit_tests_with_coverage :
71
71
runs-on : ubuntu-latest
72
72
needs : build
73
73
steps :
74
- - uses : actions/checkout@v2
75
- - uses : actions/cache@v2
74
+ - uses : actions/checkout@v3
75
+ - uses : actions/cache@v3
76
76
with :
77
77
path : ${{ env.CACHE_NODE_MODULES_PATH }}
78
78
key : node_modules-${{ hashFiles('**/package-lock.json') }}
79
- - uses : actions/cache@v2
79
+ - uses : actions/cache@v3
80
80
with :
81
81
path : ${{ env.CACHE_DIST_PATH }}
82
82
key : dist-${{ github.run_id }}
83
- - run : npm test -- --runner cloud --codeCoverage
83
+ - run : npm test -- --runner= cloud --codeCoverage
84
84
- run : npx codecov ./coverage/
85
85
continue-on-error : true
86
86
@@ -89,12 +89,12 @@ jobs:
89
89
runs-on : ubuntu-latest
90
90
needs : install
91
91
steps :
92
- - uses : actions/checkout@v2
93
- - uses : actions/cache@v2
92
+ - uses : actions/checkout@v3
93
+ - uses : actions/cache@v3
94
94
with :
95
95
path : ${{ env.CACHE_NODE_MODULES_PATH }}
96
96
key : node_modules-${{ hashFiles('**/package-lock.json') }}
97
- - run : npm run lint -- --runner cloud
97
+ - run : npm run lint -- --runner= cloud
98
98
99
99
# firebase deploy preview
100
100
firebase_preview :
@@ -103,8 +103,8 @@ jobs:
103
103
outputs :
104
104
output_url : ${{ steps.firebase_hosting_preview.outputs.details_url }}
105
105
steps :
106
- - uses : actions/checkout@v2
107
- - uses : actions/cache@v2
106
+ - uses : actions/checkout@v3
107
+ - uses : actions/cache@v3
108
108
with :
109
109
path : ${{ env.CACHE_DIST_PATH }}
110
110
key : dist-${{ github.run_id }}
@@ -118,75 +118,85 @@ jobs:
118
118
channelId : ${{ env.FIREBASE_CHANNEL }}
119
119
expires : 7d
120
120
121
- # run cypress
121
+ # run playwright
122
122
e2e_smoke :
123
- name : e2e smoke
123
+ name : e2e smoke (${{ matrix.shard }}/${{ strategy.job-total }})
124
124
runs-on : ubuntu-latest
125
125
needs : [install, build, firebase_preview]
126
126
127
127
strategy :
128
- # when one test fails, DO NOT cancel the other
129
- # containers, because this will kill Cypress processes
130
- # leaving the Dashboard hanging ...
131
- # https://github.com/cypress-io/github-action/issues/48
132
128
fail-fast : false
133
129
matrix :
134
- # run 3 copies of the current job in parallel
135
- containers : [1, 2, 3, 4, 5]
130
+ shard : [1, 2]
136
131
steps :
137
- - uses : actions/checkout@v2
138
- - uses : actions/cache@v2
132
+ - uses : actions/checkout@v3
133
+ - uses : actions/cache@v3
139
134
with :
140
135
path : ${{ env.CACHE_NODE_MODULES_PATH }}
141
136
key : node_modules-${{ hashFiles('**/package-lock.json') }}
142
- - uses : actions/cache@v2
137
+ - uses : actions/cache@v3
143
138
with :
144
139
path : ${{ env.CACHE_DIST_PATH }}
145
140
key : dist-${{ github.run_id }}
146
141
147
- # because of "record" and "parallel" parameters
148
- # these containers will load balance all found tests among themselves
142
+ - name : Install playwright browsers
143
+ run : |
144
+ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npx playwright install
145
+ npx playwright install-deps chromium
146
+
149
147
- name : smoke e2e on firebase
150
148
if : ${{ needs.firebase_preview.outputs.output_url }}
151
- run : npx nx run ngx-bootstrap-docs-e2e:e2e -- --configuration firebase --runner cloud --record --group smoke --baseUrl =${{ needs.firebase_preview.outputs.output_url }}/ngx-bootstrap/ --parallel
149
+ run : PLAYWRIGHT_TEST_BASE_URL="${{ needs.firebase_preview.outputs.output_url }}/ngx-bootstrap/" npx nx run ngx-bootstrap-docs-e2e:e2e --pwProject=chromium-integration --skipServe --shard =${{ matrix.shard }}/${{ strategy.job-total }}
152
150
153
151
- name : smoke e2e local
154
152
if : ${{ !needs.firebase_preview.outputs.output_url }}
155
- run : npx nx run ngx-bootstrap-docs-e2e:e2e -- --configuration production --runner cloud --record --group smoke --parallel
153
+ run : npx nx run ngx-bootstrap-docs-e2e:e2e --pwProject=chromium-integration --shard=${{ matrix.shard }}/${{ strategy.job-total }}
154
+
155
+ - uses : actions/upload-artifact@v3
156
+ if : always()
157
+ with :
158
+ name : playwright-report-smoke-${{ matrix.shard }}_${{ strategy.job-total }}
159
+ path : apps/ngx-bootstrap-docs-e2e/playwright-report
160
+ retention-days : 14
156
161
157
162
e2e_full :
158
163
name : e2e full
159
164
runs-on : ubuntu-latest
160
165
needs : [e2e_smoke]
161
166
162
167
strategy :
163
- # when one test fails, DO NOT cancel the other
164
- # containers, because this will kill Cypress processes
165
- # leaving the Dashboard hanging ...
166
- # https://github.com/cypress-io/github-action/issues/48
167
168
fail-fast : false
168
169
matrix :
169
- # run 3 copies of the current job in parallel
170
- containers : [1, 2, 3, 4, 5]
170
+ shard : [1, 2]
171
171
steps :
172
- - uses : actions/checkout@v2
173
- - uses : actions/cache@v2
172
+ - uses : actions/checkout@v3
173
+ - uses : actions/cache@v3
174
174
with :
175
175
path : ${{ env.CACHE_NODE_MODULES_PATH }}
176
176
key : node_modules-${{ hashFiles('**/package-lock.json') }}
177
- - uses : actions/cache@v2
177
+ - uses : actions/cache@v3
178
178
with :
179
179
path : ${{ env.CACHE_DIST_PATH }}
180
180
key : dist-${{ github.run_id }}
181
181
182
- # because of "record" and "parallel" parameters
183
- # these containers will load balance all found tests among themselves
182
+ - name : Install playwright browsers
183
+ run : |
184
+ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npx playwright install
185
+ npx playwright install-deps chromium
186
+
184
187
- name : full e2e on firebase
185
188
if : ${{ needs.firebase_preview.outputs.output_url }}
186
189
continue-on-error : true
187
- run : npx nx run ngx-bootstrap-docs-e2e:e2e -- --configuration firebase --runner cloud --cypressConfig ./apps/ngx-bootstrap-docs-e2e/cypress- full.json --record --group full -- baseUrl=${{ needs.firebase_preview.outputs.output_url }}/ngx-bootstrap/ --parallel
190
+ run : npx nx run ngx-bootstrap-docs-e2e:e2e --pwProject=chromium- full --baseUrl=${{ needs.firebase_preview.outputs.output_url }}/ngx-bootstrap/ --skipServe --shard=${{ matrix.shard }}/${{ strategy.job-total }}
188
191
189
192
- name : full e2e on local
190
193
if : ${{ !needs.firebase_preview.outputs.output_url }}
191
194
continue-on-error : true
192
- run : npx nx run ngx-bootstrap-docs-e2e:e2e -- --configuration production --runner cloud --cypressConfig ./apps/ngx-bootstrap-docs-e2e/cypress-full.json --record --group full --parallel
195
+ run : npx nx run ngx-bootstrap-docs-e2e:e2e --pwProject=chromium-full --shard=${{ matrix.shard }}/${{ strategy.job-total }}
196
+
197
+ - uses : actions/upload-artifact@v3
198
+ if : always()
199
+ with :
200
+ name : playwright-report-full-${{ matrix.shard }}_${{ strategy.job-total }}
201
+ path : apps/ngx-bootstrap-docs-e2e/playwright-report
202
+ retention-days : 14
0 commit comments