@@ -31,12 +31,25 @@ executors:
3131 resource_class : xlarge
3232
3333commands :
34+ save_merge_commit :
35+ steps :
36+ - save_cache :
37+ name : ' Save Merge Commit'
38+ key : git-{{ .Branch }}-{{ .Revision }}
39+ paths :
40+ - .git/FETCH_HEAD
41+ restore_merge_commit :
42+ steps :
43+ - restore_cache :
44+ name : ' Restore Merge Commit'
45+ key : git-{{ .Branch }}-{{ .Revision }}
3446 setup_vm :
3547 steps :
3648 - checkout
49+ - restore_merge_commit
3750 - run :
3851 name : ' Fetch Merge Commit'
39- command : ./.circleci/fetch_merge_commit.sh
52+ command : ./.circleci/fetch_merge_commit.sh merge
4053 - run :
4154 name : ' Check Config'
4255 command : ./.circleci/check_config.sh
@@ -61,6 +74,15 @@ commands:
6174 command : ./.circleci/fail_fast.sh
6275
6376jobs :
77+ ' Setup ENV ' :
78+ executor :
79+ name : amphtml-medium-executor
80+ steps :
81+ - checkout
82+ - run :
83+ name : ' Fetch Merge Commit'
84+ command : ./.circleci/fetch_merge_commit.sh fetch
85+ - save_merge_commit
6486 ' Checks ' :
6587 executor :
6688 name : amphtml-medium-executor
@@ -231,30 +253,47 @@ jobs:
231253workflows :
232254 ' CircleCI ' :
233255 jobs :
256+ - ' Setup ENV ' :
257+ << : *push_and_pr_builds
234258 - ' Checks ' :
235259 << : *push_and_pr_builds
260+ requires :
261+ - ' Setup ENV'
236262 - ' Unminified Build ' :
237263 << : *push_and_pr_builds
264+ requires :
265+ - ' Setup ENV'
238266 - ' Nomodule Build ' :
239267 << : *push_and_pr_builds
268+ requires :
269+ - ' Setup ENV'
240270 - ' Module Build ' :
241271 << : *push_and_pr_builds
272+ requires :
273+ - ' Setup ENV'
242274 - ' Bundle Size ' :
243275 << : *push_and_pr_builds
244276 requires :
277+ - ' Setup ENV'
245278 - ' Nomodule Build'
246279 - ' Module Build'
247280 - ' Validator Tests ' :
248281 << : *push_and_pr_builds
282+ requires :
283+ - ' Setup ENV'
249284 - ' Visual Diff Tests ' :
250285 << : *push_and_pr_builds
251286 requires :
287+ - ' Setup ENV'
252288 - ' Nomodule Build'
253289 - ' Unit Tests ' :
254290 << : *push_and_pr_builds
291+ requires :
292+ - ' Setup ENV'
255293 - ' Unminified Tests ' :
256294 << : *push_and_pr_builds
257295 requires :
296+ - ' Setup ENV'
258297 - ' Unminified Build'
259298 - ' Nomodule Tests ' :
260299 name : ' Nomodule Tests (<< matrix.config >>)'
@@ -263,6 +302,7 @@ workflows:
263302 config : ['prod', 'canary']
264303 << : *push_and_pr_builds
265304 requires :
305+ - ' Setup ENV'
266306 - ' Nomodule Build'
267307 - ' Module Tests ' :
268308 name : ' Module Tests (<< matrix.config >>)'
@@ -271,28 +311,34 @@ workflows:
271311 config : ['prod', 'canary']
272312 << : *push_and_pr_builds
273313 requires :
314+ - ' Setup ENV'
274315 - ' Nomodule Build'
275316 - ' Module Build'
276317 - ' End-to-End Tests ' :
277318 << : *push_and_pr_builds
278319 requires :
320+ - ' Setup ENV'
279321 - ' Nomodule Build'
280322 - ' Experiment Build ' :
281323 name : ' Experiment << matrix.exp >> Build'
282324 matrix :
283325 parameters :
284326 exp : ['A', 'B', 'C']
285327 << : *push_and_pr_builds
328+ requires :
329+ - ' Setup ENV'
286330 - ' Experiment Tests ' :
287331 name : ' Experiment << matrix.exp >> Tests'
288332 matrix :
289333 parameters :
290334 exp : ['A', 'B', 'C']
291335 << : *push_and_pr_builds
292336 requires :
337+ - ' Setup ENV'
293338 - ' Experiment << matrix.exp >> Build'
294339 # TODO(wg-performance, #12128): This takes 30 mins and fails regularly.
295340 # - 'Performance Tests':
296341 # <<: *push_builds_only
297342 # requires:
343+ # - 'Setup ENV'
298344 # - 'Nomodule Build'
0 commit comments