|
1 |
| -# Note: YAML anchors allow an object to be re-used, reducing duplication. |
2 |
| -# The ampersand declares an alias for an object, then later the `<<: *name` |
3 |
| -# syntax dereferences it. |
4 |
| -# See https://blog.daemonl.com/2016/02/yaml.html |
5 |
| -# To validate changes, use an online parser, eg. |
6 |
| -# https://yaml-online-parser.appspot.com/ |
| 1 | +# This config is remaining in place to prevent pull requests failing because of CircleCI config missing. |
7 | 2 |
|
8 |
| -# CircleCI configuration version |
9 |
| -# Version 2.1 allows for extra config reuse features |
10 |
| -# https://circleci.com/docs/2.0/reusing-config/#getting-started-with-config-reuse |
11 | 3 | version: 2.1
|
12 | 4 |
|
13 |
| -orbs: |
14 |
| - browser-tools: circleci/[email protected] |
15 |
| - devinfra: angular/[email protected] |
16 |
| - |
17 |
| -# Cache key for CircleCI. We want to invalidate the cache whenever the Yarn lock file changes. |
18 |
| -var_1: &cache_key material-angular-io-{{ .Branch }}-{{ checksum "yarn.lock" }} |
19 |
| -var_2: &default_docker_image cimg/node:20.11.1-browsers |
20 |
| - |
21 |
| -# Settings common to each job |
22 |
| -var_3: &job_defaults |
23 |
| - working_directory: ~/material-angular-io |
24 |
| - docker: |
25 |
| - - image: *default_docker_image |
26 |
| - |
27 |
| -var_4: &save_cache |
28 |
| - save_cache: |
29 |
| - key: *cache_key |
30 |
| - paths: |
31 |
| - - 'node_modules' |
32 |
| - |
33 |
| -var_5: &yarn_install |
34 |
| - run: |
35 |
| - name: 'Installing project dependencies' |
36 |
| - command: yarn install --immutable |
37 |
| - no_output_timeout: 20m |
38 |
| - |
39 |
| -# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs |
40 |
| -# https://circleci.com/blog/deep-diving-into-circleci-workspaces/ |
41 |
| -var_6: &workspace_location ~/ |
42 |
| - |
43 |
| -commands: |
44 |
| - store_build_output: |
45 |
| - description: 'Stores build artifacts' |
46 |
| - steps: |
47 |
| - - run: |
48 |
| - name: Move compiled apps to workspace |
49 |
| - command: | |
50 |
| - set -exu |
51 |
| - mkdir -p ~/dist |
52 |
| - mv dist/* ~/dist/ |
53 |
| - - persist_to_workspace: |
54 |
| - root: *workspace_location |
55 |
| - paths: |
56 |
| - - dist |
57 |
| - |
58 | 5 | jobs:
|
59 |
| - lint: |
60 |
| - <<: *job_defaults |
61 |
| - steps: |
62 |
| - - checkout |
63 |
| - - restore_cache: |
64 |
| - key: *cache_key |
65 |
| - - *yarn_install |
66 |
| - - run: yarn lint |
67 |
| - - *save_cache |
68 |
| - |
69 |
| - build: |
70 |
| - <<: *job_defaults |
71 |
| - # We generate a lot of chunks with our build. To improve stability and to reduce |
72 |
| - # the amount it takes to run, we use a higher resource class with better VM specs. |
73 |
| - # https://circleci.com/docs/2.0/configuration-reference/#resource_class |
74 |
| - resource_class: large |
75 |
| - steps: |
76 |
| - - checkout |
77 |
| - - restore_cache: |
78 |
| - key: *cache_key |
79 |
| - - *yarn_install |
80 |
| - - run: yarn prod-build |
81 |
| - - *save_cache |
82 |
| - - store_build_output |
83 |
| - |
84 |
| - test: |
85 |
| - <<: *job_defaults |
86 |
| - steps: |
87 |
| - - checkout |
88 |
| - - restore_cache: |
89 |
| - key: *cache_key |
90 |
| - - *yarn_install |
91 |
| - - browser-tools/install-browser-tools |
92 |
| - - run: yarn test --watch false --progress=false |
93 |
| - |
94 |
| - lighthouse_audits: |
95 |
| - <<: *job_defaults |
| 6 | + pass: |
| 7 | + docker: |
| 8 | + - image: cimg/base:2022.05 |
96 | 9 | steps:
|
97 |
| - - attach_workspace: |
98 |
| - at: *workspace_location |
99 |
| - - checkout |
100 |
| - - browser-tools/install-chrome |
101 |
| - - restore_cache: |
102 |
| - key: *cache_key |
103 |
| - - *yarn_install |
104 |
| - - browser-tools/install-browser-tools |
105 |
| - - run: |
106 |
| - command: yarn test:audit:ci |
107 |
| - environment: |
108 |
| - CHROMIUM_BIN: '/usr/bin/google-chrome' |
| 10 | + - run: echo "This too shall pass (always)" |
109 | 11 |
|
110 | 12 | workflows:
|
111 | 13 | version: 2
|
112 | 14 | default_workflow:
|
113 | 15 | jobs:
|
114 |
| - - lint |
115 |
| - - build |
116 |
| - - test |
117 |
| - - lighthouse_audits: |
118 |
| - requires: |
119 |
| - - build |
| 16 | + - pass |
0 commit comments