Skip to content

Commit 5025546

Browse files
committed
chore: set caching as a job
1 parent 256d032 commit 5025546

File tree

1 file changed

+16
-36
lines changed

1 file changed

+16
-36
lines changed

.circleci/config.yml

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,17 @@ commands:
119119
- run:
120120
name: Use currently installed node version
121121
command: nvm list | awk '/<< parameters.node_version >>/ {print $1}' | xargs nvm use
122+
checkout_with_cache:
123+
description: Checkout command with caching
124+
steps:
125+
- restore_cache:
126+
keys:
127+
- &source-cache source-v1-{{ .Branch }}-{{ .Revision }}
128+
- checkout
129+
- save_cache:
130+
key: *source-cache
131+
paths:
132+
- ".git"
122133

123134
jobs:
124135
security-scans:
@@ -135,15 +146,7 @@ jobs:
135146
install_lint_build:
136147
<<: *defaults
137148
steps:
138-
- restore_cache:
139-
keys:
140-
- &source-cache source-v1-{{ .Branch }}-{{ .Revision }}
141-
- checkout
142-
- save_cache:
143-
key: *source-cache
144-
paths:
145-
- ".git"
146-
149+
- checkout_with_cache
147150
- restore_cache:
148151
keys:
149152
- v2-npm-cache-{{ checksum "package.json" }}
@@ -169,15 +172,7 @@ jobs:
169172
<<: *defaults
170173
parallelism: 4 # Run tests across 4 containers
171174
steps:
172-
- restore_cache:
173-
keys:
174-
- &source-cache source-v1-{{ .Branch }}-{{ .Revision }}
175-
- checkout
176-
- save_cache:
177-
key: *source-cache
178-
paths:
179-
- ".git"
180-
175+
- checkout_with_cache
181176
- setup_remote_docker:
182177
docker_layer_caching: true
183178
- attach_workspace:
@@ -194,15 +189,7 @@ jobs:
194189
<<: *windows_big
195190
parallelism: 2 # Run tests across 2 containers
196191
steps:
197-
- restore_cache:
198-
keys:
199-
- &source-cache source-v1-{{ .Branch }}-{{ .Revision }}
200-
- checkout
201-
- save_cache:
202-
key: *source-cache
203-
paths:
204-
- ".git"
205-
192+
- checkout_with_cache
206193
- install_node_npm:
207194
node_version: << parameters.node_version >>
208195
- setup_npm_user
@@ -212,6 +199,7 @@ jobs:
212199
name: Run Windows tests in parallel
213200
command: |
214201
echo "PWD: $PWD"
202+
echo "PWD_WSL: $(wslpath -w "$(pwd)")"
215203
GLOB=$(circleci tests glob "test/windows/**/*.spec.ts")
216204
echo "GLOB: $GLOB"
217205
GLOB_SED=$(echo $GLOB | sed s#$(pwd)\\\\##g | sed 's#\\\\#/#g')
@@ -232,15 +220,7 @@ jobs:
232220
<<: *windows_big
233221
parallelism: 2 # Run tests across 2 containers
234222
steps:
235-
- restore_cache:
236-
keys:
237-
- &source-cache source-v1-{{ .Branch }}-{{ .Revision }}
238-
- checkout
239-
- save_cache:
240-
key: *source-cache
241-
paths:
242-
- ".git"
243-
223+
- checkout_with_cache
244224
- install_node_npm:
245225
node_version: << parameters.node_version >>
246226
- setup_npm_user

0 commit comments

Comments
 (0)