Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit 51291dc

Browse files
authored
Merge pull request #209 from AtomLinter/arcanemagus/fix-ci
Update CircleCI configuration
2 parents 8a0ffb5 + 2eb12d7 commit 51291dc

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

.circleci/config.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ defaults: &defaults
1717
- run:
1818
name: APM version
1919
command: ${APM_SCRIPT_PATH} --version
20-
- run:
21-
name: Cleaning package
22-
command: ${APM_SCRIPT_PATH} clean
2320
- run:
2421
name: Package APM package dependencies
2522
command: |
@@ -31,14 +28,17 @@ defaults: &defaults
3128
- run:
3229
name: Package dependencies
3330
command: ${APM_SCRIPT_PATH} install
31+
- run:
32+
name: Cleaning package
33+
command: ${APM_SCRIPT_PATH} clean
3434
- run:
3535
name: Package specs
3636
command: ${ATOM_SCRIPT_PATH} --test spec
3737
# Cache node_modules
3838
- save_cache:
3939
paths:
4040
- node_modules
41-
key: v1-dependencies-{{ checksum "package.json" }}
41+
key: v2-dependencies-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json"}}
4242

4343
jobs:
4444
checkout_code:
@@ -50,10 +50,15 @@ jobs:
5050
# Restore node_modules from the last build
5151
- restore_cache:
5252
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
5762
# Save project state for next steps
5863
- persist_to_workspace:
5964
root: /tmp
@@ -62,7 +67,7 @@ jobs:
6267
lint:
6368
<<: *defaults
6469
docker:
65-
- image: circleci/node:latest
70+
- image: circleci/node:lts
6671
steps:
6772
# Restore project state
6873
- attach_workspace:

0 commit comments

Comments
 (0)