5
5
- master
6
6
- release/**
7
7
pull_request :
8
+ workflow_dispatch :
9
+ inputs :
10
+ commit :
11
+ description : If the commit you want to test isn't the head of a branch, provide its SHA here
12
+ required : false
8
13
9
14
env :
15
+ HEAD_COMMIT : ${{ github.event.inputs.commit || github.sha }}
16
+
10
17
CACHED_DEPENDENCY_PATHS : |
11
18
${{ github.workspace }}/node_modules
12
19
${{ github.workspace }}/packages/**/node_modules
22
29
${{ github.workspace }}/packages/ember/instance-initializers
23
30
${{ github.workspace }}/packages/serverless/dist-awslambda-layer/*.zip
24
31
25
- BUILD_CACHE_KEY : ${{ github.sha }}
32
+ BUILD_CACHE_KEY : ${{ github.event.inputs.commit || github. sha }}
26
33
27
34
jobs :
28
35
job_install_deps :
29
36
name : Install Dependencies
30
37
runs-on : ubuntu-latest
31
38
timeout-minutes : 15
32
39
steps :
33
- - name : Check out current commit (${{ github.sha }})
40
+ - name : Check out current commit (${{ env.HEAD_COMMIT }})
34
41
uses : actions/checkout@v2
35
42
- name : Set up Node
36
43
uses : actions/setup-node@v1
57
64
runs-on : ubuntu-latest
58
65
timeout-minutes : 15
59
66
steps :
60
- - name : Check out current commit (${{ github.sha }})
67
+ - name : Check out current commit (${{ env.HEAD_COMMIT }})
61
68
uses : actions/checkout@v2
62
69
- name : Set up Node
63
70
uses : actions/setup-node@v1
98
105
timeout-minutes : 15
99
106
runs-on : ubuntu-latest
100
107
steps :
101
- - name : Check out current commit (${{ github.sha }})
108
+ - name : Check out current commit (${{ env.HEAD_COMMIT }})
102
109
uses : actions/checkout@v2
103
110
- name : Set up Node
104
111
uses : actions/setup-node@v1
@@ -116,8 +123,8 @@ jobs:
116
123
key : ${{ env.BUILD_CACHE_KEY }}
117
124
- name : Check bundle sizes
118
125
uses : getsentry/size-limit-action@v4
119
- # Only run size check on master or pull requests
120
- if : github.ref == 'refs/heads/master' || github.event_name == 'pull_request'
126
+ # Don't run size check on release branches - at that point, we're already committed
127
+ if : ${{ !startsWith( github.ref, 'release') }}
121
128
with :
122
129
github_token : ${{ secrets.GITHUB_TOKEN }}
123
130
skip_step : build
@@ -128,7 +135,7 @@ jobs:
128
135
timeout-minutes : 10
129
136
runs-on : ubuntu-latest
130
137
steps :
131
- - name : Check out current commit (${{ github.sha }})
138
+ - name : Check out current commit (${{ env.HEAD_COMMIT }})
132
139
uses : actions/checkout@v2
133
140
- name : Set up Node
134
141
uses : actions/setup-node@v1
@@ -151,7 +158,7 @@ jobs:
151
158
timeout-minutes : 10
152
159
runs-on : ubuntu-latest
153
160
steps :
154
- - name : Check out current commit (${{ github.sha }})
161
+ - name : Check out current commit (${{ env.HEAD_COMMIT }})
155
162
uses : actions/checkout@v2
156
163
- name : Set up Node
157
164
uses : actions/setup-node@v1
@@ -168,6 +175,40 @@ jobs:
168
175
- name : Run madge
169
176
run : yarn circularDepCheck
170
177
178
+ job_artifacts :
179
+ name : Upload Artifacts
180
+ needs : job_build
181
+ runs-on : ubuntu-latest
182
+ # Build artifacts are only needed for releasing workflow.
183
+ if : startsWith(github.ref, 'refs/heads/release/')
184
+ steps :
185
+ - name : Check out current commit (${{ github.sha }})
186
+ uses : actions/checkout@v2
187
+ - name : Set up Node
188
+ uses : actions/setup-node@v1
189
+ - name : Check dependency cache
190
+ uses : actions/cache@v2
191
+ with :
192
+ path : ${{ env.CACHED_DEPENDENCY_PATHS }}
193
+ key : ${{ needs.job_build.outputs.dependency_cache_key }}
194
+ - name : Check build cache
195
+ uses : actions/cache@v2
196
+ with :
197
+ path : ${{ env.CACHED_BUILD_PATHS }}
198
+ key : ${{ env.BUILD_CACHE_KEY }}
199
+ - name : Pack
200
+ run : yarn build:npm
201
+ - name : Archive artifacts
202
+ uses : actions/upload-artifact@v2
203
+ with :
204
+ name : ${{ github.sha }}
205
+ path : |
206
+ ${{ github.workspace }}/packages/browser/build/bundles/**
207
+ ${{ github.workspace }}/packages/integrations/build/**
208
+ ${{ github.workspace }}/packages/tracing/build/**
209
+ ${{ github.workspace }}/packages/**/*.tgz
210
+ ${{ github.workspace }}/packages/serverless/dist-awslambda-layer/*.zip
211
+
171
212
job_unit_test :
172
213
name : Test (Node ${{ matrix.node }})
173
214
needs : job_build
@@ -178,7 +219,7 @@ jobs:
178
219
matrix :
179
220
node : [6, 8, 10, 12, 14, 16]
180
221
steps :
181
- - name : Check out current commit (${{ github.sha }})
222
+ - name : Check out current commit (${{ env.HEAD_COMMIT }})
182
223
uses : actions/checkout@v2
183
224
- name : Set up Node
184
225
uses : actions/setup-node@v1
@@ -211,7 +252,7 @@ jobs:
211
252
matrix :
212
253
node : [10, 12, 14, 16]
213
254
steps :
214
- - name : Check out current commit (${{ github.sha }})
255
+ - name : Check out current commit (${{ env.HEAD_COMMIT }})
215
256
uses : actions/checkout@v2
216
257
- name : Set up Node
217
258
uses : actions/setup-node@v1
@@ -243,7 +284,7 @@ jobs:
243
284
timeout-minutes : 30
244
285
runs-on : ubuntu-latest
245
286
steps :
246
- - name : Check out current commit (${{ github.sha }})
287
+ - name : Check out current commit (${{ env.HEAD_COMMIT }})
247
288
uses : actions/checkout@v2
248
289
# TODO: removing `fetch-depth` below seems to have no effect, and the commit which added it had no description,
249
290
# so it's not clear why it's necessary. That said, right now ember tests are xfail, so it's a little hard to
@@ -274,42 +315,8 @@ jobs:
274
315
- name : Compute test coverage
275
316
uses : codecov/codecov-action@v1
276
317
277
- job_artifacts :
278
- name : Upload Artifacts
279
- needs : job_build
280
- runs-on : ubuntu-latest
281
- # Build artifacts are only needed for releasing workflow.
282
- if : startsWith(github.ref, 'refs/heads/release/')
283
- steps :
284
- - name : Check out current commit (${{ github.sha }})
285
- uses : actions/checkout@v2
286
- - name : Set up Node
287
- uses : actions/setup-node@v1
288
- - name : Check dependency cache
289
- uses : actions/cache@v2
290
- with :
291
- path : ${{ env.CACHED_DEPENDENCY_PATHS }}
292
- key : ${{ needs.job_build.outputs.dependency_cache_key }}
293
- - name : Check build cache
294
- uses : actions/cache@v2
295
- with :
296
- path : ${{ env.CACHED_BUILD_PATHS }}
297
- key : ${{ env.BUILD_CACHE_KEY }}
298
- - name : Pack
299
- run : yarn build:npm
300
- - name : Archive artifacts
301
- uses : actions/upload-artifact@v2
302
- with :
303
- name : ${{ github.sha }}
304
- path : |
305
- ${{ github.workspace }}/packages/browser/build/bundles/**
306
- ${{ github.workspace }}/packages/integrations/build/**
307
- ${{ github.workspace }}/packages/tracing/build/**
308
- ${{ github.workspace }}/packages/**/*.tgz
309
- ${{ github.workspace }}/packages/serverless/dist-awslambda-layer/*.zip
310
-
311
318
job_browser_playwright_tests :
312
- name : Browser Playwright Tests ( ${{ matrix.bundle }} - tracing_only = ${{ matrix.tracing_only }})
319
+ name : Playwright - ${{ ( matrix.tracing_only && 'Browser + Tracing') || 'Browser' }} ( ${{ matrix.bundle }})
313
320
needs : job_build
314
321
runs-on : ubuntu-latest
315
322
strategy :
@@ -325,12 +332,14 @@ jobs:
325
332
- true
326
333
- false
327
334
exclude :
335
+ # `tracing_only` only makes a difference for bundles - tests of the esm and cjs builds always include the
336
+ # tracing tests
328
337
- bundle : esm
329
- tracing_only : true
338
+ tracing_only : false
330
339
- bundle : cjs
331
- tracing_only : true
340
+ tracing_only : false
332
341
steps :
333
- - name : Check out current commit (${{ github.sha }})
342
+ - name : Check out current commit (${{ env.HEAD_COMMIT }})
334
343
uses : actions/checkout@v2
335
344
- name : Set up Node
336
345
uses : actions/setup-node@v1
@@ -356,7 +365,7 @@ jobs:
356
365
yarn test:ci
357
366
358
367
job_browser_integration_tests :
359
- name : Browser Integration Tests (${{ matrix.browser }})
368
+ name : Old Browser Integration Tests (${{ matrix.browser }})
360
369
needs : job_build
361
370
runs-on : ubuntu-latest
362
371
timeout-minutes : 10
@@ -368,7 +377,7 @@ jobs:
368
377
- FirefoxHeadless
369
378
- WebkitHeadless
370
379
steps :
371
- - name : Check out current commit (${{ github.sha }})
380
+ - name : Check out current commit (${{ env.HEAD_COMMIT }})
372
381
uses : actions/checkout@v2
373
382
- name : Set up Node
374
383
uses : actions/setup-node@v1
@@ -397,7 +406,7 @@ jobs:
397
406
timeout-minutes : 5
398
407
continue-on-error : true
399
408
steps :
400
- - name : Check out current commit (${{ github.sha }})
409
+ - name : Check out current commit (${ env.HEAD_COMMIT }})
401
410
uses : actions/checkout@v2
402
411
- name : Set up Node
403
412
uses : actions/setup-node@v1
0 commit comments