@@ -17,9 +17,6 @@ defaults: &defaults
17
17
- run :
18
18
name : APM version
19
19
command : ${APM_SCRIPT_PATH} --version
20
- - run :
21
- name : Cleaning package
22
- command : ${APM_SCRIPT_PATH} clean
23
20
- run :
24
21
name : Package APM package dependencies
25
22
command : |
@@ -31,14 +28,17 @@ defaults: &defaults
31
28
- run :
32
29
name : Package dependencies
33
30
command : ${APM_SCRIPT_PATH} install
31
+ - run :
32
+ name : Cleaning package
33
+ command : ${APM_SCRIPT_PATH} clean
34
34
- run :
35
35
name : Package specs
36
36
command : ${ATOM_SCRIPT_PATH} --test spec
37
37
# Cache node_modules
38
38
- save_cache :
39
39
paths :
40
40
- node_modules
41
- key : v1 -dependencies-{{ checksum "package.json" }}
41
+ key : v2 -dependencies-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
42
42
43
43
jobs :
44
44
checkout_code :
@@ -50,10 +50,15 @@ jobs:
50
50
# Restore node_modules from the last build
51
51
- restore_cache :
52
52
keys :
53
- # Get latest cache for this package.json
54
- - v1-dependencies-{{ checksum "package.json" }}
55
- # Fallback to the last available cache
56
- - v1-dependencies
53
+ # Get latest cache for this package.json and package-lock.json
54
+ - v2-dependencies-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json"}}
55
+ # Fallback to the current package.json
56
+ - v2-dependencies-{{ .Branch }}-{{ checksum "package.json" }}-
57
+ # Fallback to the last build for this branch
58
+ - v2-dependencies-{{ .Branch }}-
59
+ # Fallback to the last available master branch cache
60
+ - v2-dependencies-master-
61
+ # Don't go further down to prevent dependency issues from other branches
57
62
# Save project state for next steps
58
63
- persist_to_workspace :
59
64
root : /tmp
62
67
lint :
63
68
<< : *defaults
64
69
docker :
65
- - image : circleci/node:latest
70
+ - image : circleci/node:lts
66
71
steps :
67
72
# Restore project state
68
73
- attach_workspace :
0 commit comments