Skip to content

Commit

Permalink
🔧(ci) use yarn.lock instead of package.json checksum as cache key
Browse files Browse the repository at this point in the history
We were using a package.json checksum as cache key, but this is not
ideal as it means we still get cache hits if yarn.lock is updated
when package.json is not.

On the other hand, whenever package.json is updated, yarn.lock will
necessarily be updated too.
  • Loading branch information
mbenadda committed Feb 4, 2019
1 parent 710b388 commit 632e197
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ jobs:
- checkout
- restore_cache:
keys:
- v3-front-dependencies-{{ checksum "package.json" }}
- v3-front-dependencies-{{ checksum "yarn.lock" }}
- attach_workspace:
at: ~/fun/src/richie/locale
- run:
Expand Down Expand Up @@ -533,7 +533,7 @@ jobs:
- save_cache:
paths:
- ./node_modules
key: v3-front-dependencies-{{ checksum "package.json" }}
key: v3-front-dependencies-{{ checksum "yarn.lock" }}

lint-front-tslint:
docker:
Expand All @@ -543,7 +543,7 @@ jobs:
- checkout
- restore_cache:
keys:
- v3-front-dependencies-{{ checksum "package.json" }}
- v3-front-dependencies-{{ checksum "yarn.lock" }}
- run:
name: Lint code with tslint
command: yarn lint
Expand All @@ -556,7 +556,7 @@ jobs:
- checkout
- restore_cache:
keys:
- v3-front-dependencies-{{ checksum "package.json" }}
- v3-front-dependencies-{{ checksum "yarn.lock" }}
- run:
name: Lint JS/TS/JSON and CSS/SCSS code with prettier
command: yarn prettier --list-different "src/richie-front/js/**/*.+(ts|tsx|json|js|jsx)" "*.+(ts|tsx|json|js|jsx)" "src/**/*.+(css|scss)"
Expand All @@ -569,7 +569,7 @@ jobs:
- checkout
- restore_cache:
keys:
- v3-front-dependencies-{{ checksum "package.json" }}
- v3-front-dependencies-{{ checksum "yarn.lock" }}
- run:
name: Run tests
# Circle CI needs the tests to be ran sequentially, otherwise it hangs. See Jest docs below:
Expand Down

0 comments on commit 632e197

Please sign in to comment.