Skip to content

Commit d77025e

Browse files
committed
Add step to pre-build npm cache – Will it make builds faster?
1 parent 1142b91 commit d77025e

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/bin/bash -eu
22

3-
echo "--- :npm: Install Node dependencies"
43
# --legacy-peer-deps is necessary because of react-monaco-editor.
54
# See README for more details
6-
npm ci --legacy-peer-deps
5+
install_npm_packages_clean --legacy-peer-deps

.buildkite/pipeline.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
1+
env:
2+
BUILDKITE_PLUGINS_ALWAYS_CLONE_FRESH: 1
3+
14
steps:
5+
- label: Build cache
6+
key: build_cache
7+
agents:
8+
queue: mac
9+
env:
10+
IMAGE_ID: $IMAGE_ID
11+
plugins:
12+
- $CI_TOOLKIT_PLUGIN
13+
- $NVM_PLUGIN
14+
command: |
15+
echo "--- :npm: Pre-build npm cache if needed"
16+
.buildkite/commands/install_node_dependencies.sh
17+
218
- label: Lint
319
key: lint
20+
depends_on: build_cache
421
agents:
522
queue: mac
623
env:
724
IMAGE_ID: $IMAGE_ID
825
NODE_ENV: test
926
plugins:
27+
- $CI_TOOLKIT_PLUGIN
1028
- $NVM_PLUGIN
1129
command: |
1230
.buildkite/commands/install_node_dependencies.sh
@@ -15,12 +33,14 @@ steps:
1533
1634
- label: Test
1735
key: test
36+
depends_on: build_cache
1837
agents:
1938
queue: mac
2039
env:
2140
IMAGE_ID: $IMAGE_ID
2241
NODE_ENV: test
2342
plugins:
43+
- $CI_TOOLKIT_PLUGIN
2444
- $NVM_PLUGIN
2545
command: |
2646
.buildkite/commands/install_node_dependencies.sh

.buildkite/shared-pipeline-vars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# The ~> modifier is not currently used, but we check for it just in case
77
XCODE_VERSION=$(sed -E -n 's/^(~> )?(.*)/xcode-\2/p' .xcode-version)
8-
CI_TOOLKIT_PLUGIN_VERSION='3.3.0'
8+
CI_TOOLKIT_PLUGIN_VERSION='mokagio/npm_ci'
99
NVM_PLUGIN_VERSION='0.3.0'
1010

1111
export IMAGE_ID="$XCODE_VERSION"

0 commit comments

Comments
 (0)