Skip to content

Commit c4aa0b8

Browse files
akoushkelalli-flores
authored andcommitted
perf(circleci): use workspace to presist the data between the jobs
1 parent 73b698d commit c4aa0b8

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

.circleci/config.yml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,36 @@ executors:
88

99
# reusable command for all jobs
1010
commands:
11-
checkout_from_cache:
12-
description: 'To checkout and restore the dependencies cache'
11+
checkout_from_workspace:
12+
description: 'To checkout and attach the workspace'
1313
steps:
1414
- checkout
15-
- restore_cache:
16-
keys:
17-
- dependency-cache-{{ checksum "package.json" }}
18-
- dependency-cache-
15+
- attach_workspace:
16+
at: ~/webex-components
1917

2018
# define jobs
2119
jobs:
2220
install:
2321
executor: main-executor
2422
steps:
25-
- checkout_from_cache
23+
- checkout
24+
- restore_cache:
25+
keys:
26+
- dependency-cache-{{ checksum "package-lock.json" }}
2627
- run:
2728
name: Install Dependencies
28-
command: npm ci
29+
command: npm i
2930
- save_cache:
30-
key: dependency-cache-{{ checksum "package.json" }}
31+
key: dependency-cache-{{ checksum "package-lock.json" }}
3132
paths: node_modules
33+
- persist_to_workspace:
34+
root: .
35+
paths: node_modules
36+
3237
test:
3338
executor: main-executor
3439
steps:
35-
- checkout_from_cache
40+
- checkout_from_workspace
3641
- run:
3742
name: Linting
3843
command: npm run test:eslint
@@ -41,24 +46,28 @@ jobs:
4146
command: npm run test:coverage
4247
- store_test_results:
4348
path: test_results
49+
4450
build:
4551
executor: main-executor
4652
steps:
47-
- checkout_from_cache
53+
- checkout_from_workspace
4854
- run:
49-
name: build
55+
name: Build
5056
command: npm run build
57+
- persist_to_workspace:
58+
root: .
59+
paths: dist
60+
5161
release:
5262
executor: main-executor
5363
steps:
54-
- checkout_from_cache
64+
- checkout_from_workspace
5565
- run:
56-
name: release
66+
name: Release
5767
command: npm run release
5868

5969
# execute the jobs in a orderly manner
6070
workflows:
61-
version: 2
6271
setup_test_release:
6372
jobs:
6473
- install

0 commit comments

Comments
 (0)