@@ -38,7 +38,7 @@ var_6: &save_cache
3838 save_cache :
3939 key : *cache_key
4040 paths :
41- - " node_modules "
41+ - ~/.cache/yarn
4242
4343# Job step that ensures that the node module dependencies are installed and up-to-date. We use
4444# Yarn with the frozen lockfile option in order to make sure that lock file and package.json are
@@ -59,15 +59,7 @@ var_8: &docker-firefox-image
5959# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
6060var_9 : &attach_release_output
6161 attach_workspace :
62- at : dist/releases
63-
64- # Anchor that can be used to download and install Yarn globally in the bash environment.
65- var_10 : &yarn_download
66- run :
67- name : " Downloading and installing Yarn"
68- command : |
69- touch $BASH_ENV
70- curl -o- -L https://yarnpkg.com/install.sh | PROFILE=$BASH_ENV bash -s -- --version "1.19.1"
62+ at : .
7163
7264# -----------------------------
7365# Container version of CircleCI
@@ -79,7 +71,6 @@ version: 2
7971# must be part of a workflow definition in order to run for PRs and push builds.
8072# -----------------------------------------------------------------------------------------
8173jobs :
82-
8374 # -----------------------------------
8475 # Build job
8576 # -----------------------------------
@@ -88,15 +79,21 @@ jobs:
8879 steps :
8980 - *checkout_code
9081 - *restore_cache
91- - *yarn_download
9282 - *yarn_install
9383
94- - run : yarn gulp :publish: build-releases
84+ - run : yarn build
9585
9686 # Note: We want to save the cache in this job because the workspace cache also
9787 # includes the build cache that will be updated in this job.
9888 - *save_cache
9989
90+ # Store the release output in the workspace storage. This means that other jobs
91+ # in the same workflow can attach the release output to their job.
92+ - persist_to_workspace :
93+ root : ' .'
94+ paths :
95+ - node_modules
96+ - dist/releases
10097 # ------------------------------------------------------------------------------------------
10198 # Job that runs the unit tests on locally installed browsers (Chrome and Firefox headless).
10299 # The available browsers are installed through the angular/ngcontainer Docker image.
@@ -105,10 +102,7 @@ jobs:
105102 docker : *docker-firefox-image
106103 steps :
107104 - *checkout_code
108- - *restore_cache
109- - *yarn_download
110- - *yarn_install
111-
105+ - *attach_release_output
112106 - run : ./scripts/circleci/run-local-browser-tests.sh
113107
114108 # ----------------------------------------------------------------------------
@@ -118,14 +112,12 @@ jobs:
118112 tests_browserstack :
119113 << : *job_defaults
120114 environment :
121- BROWSER_STACK_USERNAME : " adamplumer1"
122- BROWSER_STACK_ACCESS_KEY : " WgLjxoB2zQ3tqmsznKnz"
115+ BROWSER_STACK_USERNAME : ' adamplumer1'
116+ BROWSER_STACK_ACCESS_KEY : ' WgLjxoB2zQ3tqmsznKnz'
123117 steps :
124118 - *checkout_code
125119 - *restore_cache
126- - *yarn_download
127- - *yarn_install
128-
120+ - *attach_release_output
129121 - run : ./scripts/circleci/run-browserstack-tests.sh
130122
131123 # ----------------------------------------------------------------------------
@@ -135,16 +127,14 @@ jobs:
135127 tests_saucelabs :
136128 << : *job_defaults
137129 environment :
138- SAUCE_USERNAME : " angular-flex-layout"
139- SAUCE_ACCESS_KEY : " fa20eb1f457c-1f1a-c4c4-41ea-ef9e7f13"
130+ SAUCE_USERNAME : ' angular-flex-layout'
131+ SAUCE_ACCESS_KEY : ' fa20eb1f457c-1f1a-c4c4-41ea-ef9e7f13'
140132 # Note: This number should not be too high because otherwise we might run into
141133 # a rate limit exception.
142134 KARMA_PARALLEL_BROWSERS : 2
143135 steps :
144136 - *checkout_code
145- - *restore_cache
146- - *yarn_download
147- - *yarn_install
137+ - *attach_release_output
148138
149139 - run : ./scripts/circleci/run-saucelabs-tests.sh
150140
@@ -156,50 +146,22 @@ jobs:
156146 steps :
157147 - *checkout_code
158148 - *restore_cache
159- - *yarn_download
160- - *yarn_install
149+ - *attach_release_output
161150
162- - run : yarn gulp ci :ssr
151+ - run : yarn test :ssr
163152
164153 # -------------------------------------------------------------------------
165154 # Job that pre-render's the universal app with `@angular/platform-server`.
166155 # This verifies that Angular Layout can be rendered within Node.
167156 # -------------------------------------------------------------------------
168- prerender_build :
169- << : *job_defaults
170- steps :
171- - *checkout_code
172- - *restore_cache
173- - *yarn_download
174- - *yarn_install
175-
176- - run : yarn gulp ci:prerender
177-
178- # -------------------------------------------------------------------------
179- # Job that makes sure Angular Layout can be integrated with a basic app
180- # -------------------------------------------------------------------------
181- hello_world_build :
182- << : *job_defaults
183- steps :
184- - *checkout_code
185- - *restore_cache
186- - *yarn_download
187- - *yarn_install
188-
189- - run : yarn gulp ci:hw
190-
191- # -------------------------------------------------------------------------
192- # Job that makes sure Angular Layout can be integrated with the demo app
193- # -------------------------------------------------------------------------
194- aot_build :
157+ integration_tests :
195158 << : *job_defaults
196159 steps :
197160 - *checkout_code
198- - *restore_cache
199- - *yarn_download
200- - *yarn_install
161+ - *attach_release_output
201162
202- - run : yarn gulp ci:aot
163+ - run : yarn ng build demo-app
164+ - run : yarn build:universal-demo-app
203165
204166 # ----------------------------------
205167 # Lint job. Runs the gulp lint task.
@@ -209,50 +171,9 @@ jobs:
209171 steps :
210172 - *checkout_code
211173 - *restore_cache
212- - *yarn_download
213- - *yarn_install
214-
215- - run : yarn gulp ci:lint
216-
217- # -------------------------------------------------------------------------------------------
218- # Job that builds all release packages with Gulp. The built packages can be then used in the
219- # same workflow to publish snapshot builds or test the dev-app with the release packages.
220- # -------------------------------------------------------------------------------------------
221- build_release_packages :
222- << : *job_defaults
223- steps :
224- - *checkout_code
225- - *restore_cache
226- - *yarn_download
227174 - *yarn_install
228175
229- - run : yarn gulp ci:build-release-packages
230-
231- # Store the release output in the workspace storage. This means that other jobs
232- # in the same workflow can attach the release output to their job.
233- - persist_to_workspace :
234- root : dist/releases
235- paths :
236- - " **/*"
237-
238- # Since there is no UMD bundle that includes everything, we need to move
239- # all bundles into a directory. This allows us to store all UMD bundles as job
240- # artifacts that can be picked up by the Angular Github bot.
241- - run :
242- name : Prepare artifacts for publish.
243- command : |
244- mkdir -p /tmp/layout-umd-minified-bundles
245- cp dist/releases/flex-layout/bundles/*.umd.min.js /tmp/layout-umd-minified-bundles
246- # Publish bundle artifacts which will be used to calculate the size change.
247- # Note: Make sure that the size plugin from the Angular robot fetches the artifacts
248- # from this CircleCI job (see .github/angular-robot.yml). Additionally any artifacts need to
249- # be stored with the following path format: "{projectName}/{context}/{fileName}"
250- # This format is necessary because otherwise the bot is not able to pick up the
251- # artifacts from CircleCI. See:
252- # https://github.com/angular/github-robot/blob/master/functions/src/plugins/size.ts#L392-L394
253- - store_artifacts :
254- path : /tmp/layout-umd-minified-bundles
255- destination : /angular_layout/layout_release_output/
176+ - run : yarn lint
256177
257178 # ----------------------------------------
258179 # Job that publishes the build snapshots
@@ -268,10 +189,8 @@ jobs:
268189 command : ' [[ -n ${CIRCLE_PR_NUMBER} ]] && circleci step halt || true'
269190
270191 - *checkout_code
271- - *restore_cache
272- - *yarn_download
273- - *yarn_install
274192 - *attach_release_output
193+ - run : yarn stamp
275194
276195 # CircleCI has a config setting to enforce SSH for all github connections.
277196 # This is not compatible with our mechanism of using a Personal Access Token
@@ -289,37 +208,33 @@ jobs:
289208# ----------------------------------------------------------------------------------------
290209workflows :
291210 version : 2
292-
293- # Build and test workflow. A workflow includes multiple jobs that run in parallel. All jobs
294- # that build and test source code should be part of this workflow
295- build :
211+ default_workflow :
296212 jobs :
213+ # Build and test workflow. A workflow includes multiple jobs that run in parallel. All jobs
214+ # that build and test source code should be part of this workflow
297215 - build
298-
299- unit_tests :
300- jobs :
301- - tests_local_browsers
302- - tests_browserstack
303- - tests_saucelabs
304- - tests_ssr
305-
306- integration_tests :
307- jobs :
308- - prerender_build
309- - hello_world_build
310- - aot_build
311-
312- release_output :
313- jobs :
314- - build_release_packages
216+ - lint
217+ - tests_local_browsers :
218+ requires :
219+ - build
220+ - tests_browserstack :
221+ requires :
222+ - build
223+ - tests_saucelabs :
224+ requires :
225+ - build
226+ - tests_ssr :
227+ requires :
228+ - build
229+ - integration_tests :
230+ requires :
231+ - build
315232 - publish_snapshots :
316233 requires :
317- - build_release_packages
318-
319- # Lint workflow. As we want to lint in one job, this is a workflow with just one job.
320- lint :
321- jobs :
322- - lint
234+ - tests_browserstack
235+ - tests_saucelabs
236+ - tests_local_browsers
237+ - integration_tests
323238
324239# ---------------------------
325240# General setup for CircleCI
0 commit comments