Skip to content

Commit 265d999

Browse files
committed
feat: cache money
1 parent 762badd commit 265d999

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

.circleci/config.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ jobs:
157157
destination: test-logs
158158
test_jest_windows_with_docker:
159159
<<: *windows_medium
160-
parallelism: 4 # Run tests across 4 containers
160+
parallelism: 2 # Run tests across 2 containers
161161
steps:
162162
- checkout
163163
- install_node_npm:
@@ -166,13 +166,14 @@ jobs:
166166
- run: npm ci
167167
- run: docker version
168168
- run:
169-
name: Run windows tests in parallel
169+
name: Run Windows tests in parallel
170170
command: |
171171
TEST=$(npx jest --listTests --config test/windows/jest.config.js | circleci tests split --split-by=timings)
172172
npm run test-jest-windows -- $TEST
173173
no_output_timeout: 20m
174174
test_jest_windows_no_docker:
175175
<<: *windows_big
176+
parallelism: 2 # Run tests across 2 containers
176177
steps:
177178
- checkout
178179
- install_node_npm:
@@ -182,8 +183,10 @@ jobs:
182183
# make docker appear to be broken.
183184
- run: "function docker() { return 1; }"
184185
- run:
185-
command: npm run test-jest-windows
186-
no_output_timeout: 20m
186+
name: Run Windows tests in parallel
187+
command: |
188+
TEST=$(npx jest --listTests --config test/windows/jest.config.js | circleci tests split --split-by=timings)
189+
npm run test-jest-windows -- $TEST
187190
build:
188191
<<: *defaults
189192
steps:
@@ -199,9 +202,21 @@ jobs:
199202
- run:
200203
name: Setup NPM credentials
201204
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ../.npmrc
205+
- run:
206+
name: Get latest CLI commit hash
207+
command: |
208+
CLI_COMMIT_HASH=$(git ls-remote https://github.com/snyk/cli.git main | cut -f1)
209+
echo "export CLI_COMMIT_HASH=$CLI_COMMIT_HASH" >> $BASH_ENV
210+
- restore_cache:
211+
keys:
212+
- v1-cli-repo-{{ env.CLI_COMMIT_HASH }}
202213
- run:
203214
name: Build Snyk CLI with latest changes
204215
command: ./.circleci/build-cli.sh
216+
- save_cache:
217+
key: v1-cli-repo-{{ env.CLI_COMMIT_HASH }}
218+
paths:
219+
- ~/cli
205220
build_and_test_latest_go_binary:
206221
<<: *defaults
207222
resource_class: medium

0 commit comments

Comments
 (0)