Skip to content

Commit 864918b

Browse files
committed
chore: try workspace
1 parent 0c50935 commit 864918b

1 file changed

Lines changed: 20 additions & 18 deletions

File tree

.circleci/config.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -130,19 +130,16 @@ commands:
130130
key: *source-cache
131131
paths:
132132
- ".git"
133-
checkout_with_cache_windows:
134-
description: Checkout command with caching, for Windows
133+
134+
jobs:
135+
prepare_workspace:
136+
<<: *defaults
135137
steps:
136-
- restore_cache:
137-
keys:
138-
- &source-cache source-v1-win-{{.Environment.CIRCLE_NODE_INDEX}}{{ .Branch }}-{{ .Revision }}
139138
- checkout
140-
- save_cache:
141-
key: *source-cache
139+
- persist_to_workspace:
140+
root: .
142141
paths:
143-
- ".git"
144-
145-
jobs:
142+
- '*'
146143
security-scans:
147144
<<: *defaults
148145
steps:
@@ -157,7 +154,8 @@ jobs:
157154
install_lint_build:
158155
<<: *defaults
159156
steps:
160-
- checkout_with_cache
157+
- attach_workspace:
158+
at: ~/snyk-docker-plugin
161159
- restore_cache:
162160
keys:
163161
- v2-npm-cache-{{ checksum "package.json" }}
@@ -183,11 +181,10 @@ jobs:
183181
<<: *defaults
184182
parallelism: 4 # Run tests across 4 containers
185183
steps:
186-
- checkout_with_cache
187-
- setup_remote_docker:
188-
docker_layer_caching: true
189184
- attach_workspace:
190185
at: ~/snyk-docker-plugin
186+
- setup_remote_docker:
187+
docker_layer_caching: true
191188
- run:
192189
name: Run tests in parallel
193190
command: |
@@ -200,7 +197,8 @@ jobs:
200197
<<: *windows_big
201198
parallelism: 2 # Run tests across 2 containers
202199
steps:
203-
- checkout_with_cache_windows
200+
- attach_workspace:
201+
at: ~/snyk-docker-plugin
204202
- install_node_npm:
205203
node_version: << parameters.node_version >>
206204
- restore_cache:
@@ -223,14 +221,15 @@ jobs:
223221
npm run test-jest-windows -- --reporters=default --reporters=jest-junit $TEST
224222
environment:
225223
JEST_JUNIT_OUTPUT_DIR: './reports/junit'
226-
JEST_JUNIT_ADD_FILE_ATTRIBUTE: 'true' # You need this to make --split-by=timings work. Once added, it'll work from the second run onwards.
224+
JEST_JUNIT_ADD_FILE_ATTRIBUTE: 'true' # We need this to make --split-by=timings work
227225
- store_test_results:
228226
path: reports
229227
test_jest_windows_no_docker:
230228
<<: *windows_big
231229
parallelism: 2 # Run tests across 2 containers
232230
steps:
233-
- checkout_with_cache_windows
231+
- attach_workspace:
232+
at: ~/snyk-docker-plugin
234233
- install_node_npm:
235234
node_version: << parameters.node_version >>
236235
- setup_npm_user
@@ -244,7 +243,7 @@ jobs:
244243
npm run test-jest-windows -- --reporters=default --reporters=jest-junit $TEST
245244
environment:
246245
JEST_JUNIT_OUTPUT_DIR: './reports/junit'
247-
JEST_JUNIT_ADD_FILE_ATTRIBUTE: 'true' # You need this to make --split-by=timings work. Once added, it'll work from the second run onwards.
246+
JEST_JUNIT_ADD_FILE_ATTRIBUTE: 'true' # We need this to make --split-by=timings work
248247
- store_test_results:
249248
path: reports
250249
build_cli:
@@ -306,6 +305,7 @@ workflows:
306305
not:
307306
equal: [scheduled_pipeline, << pipeline.trigger_source >>]
308307
jobs:
308+
- prepare_workspace
309309
- prodsec/secrets-scan:
310310
name: Scan repository for secrets
311311
context:
@@ -321,6 +321,8 @@ workflows:
321321
- snyk-bot-slack
322322
post-steps:
323323
- *slack-fail-notify
324+
requires:
325+
- prepare_workspace
324326
- security-scans:
325327
name: Security Scans
326328
context: infrasec_container

0 commit comments

Comments
 (0)