Skip to content

Commit 8c3d5a3

Browse files
authored
Merge pull request #5788 from plotly/speedup-dist-publish-and-test
Speed up publishing dist on the CircleCI and testing bundles
2 parents 7468ec2 + 41cc6c8 commit 8c3d5a3

File tree

2 files changed

+14
-47
lines changed

2 files changed

+14
-47
lines changed

.circleci/config.yml

Lines changed: 8 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,8 @@ jobs:
1515
steps:
1616
- checkout
1717
- run:
18-
name: set heap option before very first node.js call
19-
command: |
20-
export NODE_OPTIONS='--max-old-space-size=4096'
21-
- run:
22-
name: Install dependencies
23-
command: |
24-
npm ci
25-
- run:
26-
name: List dependency versions
27-
command: |
28-
echo "npm: $(npm --version)"
29-
echo "node: $(node --version)"
30-
npm ls || true
18+
name: set up build environment
19+
command: .circleci/env_build.sh
3120
- run:
3221
name: Pretest
3322
command: |
@@ -194,8 +183,10 @@ jobs:
194183
- image: circleci/node:12.22.1
195184
working_directory: ~/plotly.js
196185
steps:
197-
- attach_workspace:
198-
at: ~/
186+
- checkout
187+
- run:
188+
name: set up build environment
189+
command: .circleci/env_build.sh
199190
- run:
200191
name: Build dist/
201192
command: npm run build
@@ -219,18 +210,6 @@ jobs:
219210
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plotly.js
220211
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plotly.min.js
221212
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plot-schema.json
222-
- persist_to_workspace:
223-
root: ~/
224-
paths:
225-
- plotly.js
226-
227-
test-dist1:
228-
docker:
229-
- image: circleci/node:12.22.1
230-
working_directory: ~/plotly.js
231-
steps:
232-
- attach_workspace:
233-
at: ~/
234213
- run:
235214
name: Test plotly.min.js import using requirejs
236215
command: npm run test-requirejs
@@ -240,20 +219,9 @@ jobs:
240219
- run:
241220
name: Test certain bundles against function constructors
242221
command: npm run no-new-func
243-
244-
test-dist2:
245-
docker:
246-
- image: circleci/node:12.22.1
247-
working_directory: ~/plotly.js
248-
steps:
249-
- attach_workspace:
250-
at: ~/
251222
- run:
252223
name: Test plotly bundles against es6
253224
command: npm run no-es6-dist
254-
- run:
255-
name: Test plotly bundles againt duplicate keys
256-
command: npm run no-dup-keys
257225

258226
workflows:
259227
version: 2
@@ -290,12 +258,5 @@ workflows:
290258
- source-syntax:
291259
requires:
292260
- install-and-cibuild
293-
- publish-dist:
294-
requires:
295-
- install-and-cibuild
296-
- test-dist1:
297-
requires:
298-
- publish-dist
299-
- test-dist2:
300-
requires:
301-
- publish-dist
261+
262+
- publish-dist

.circleci/env_build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
export NODE_OPTIONS='--max-old-space-size=4096' && \
3+
echo "node version: $(node --version)" && \
4+
echo "npm version: $(npm --version)" && \
5+
npm ci && \
6+
npm ls || true

0 commit comments

Comments
 (0)