Skip to content

Commit

Permalink
Try a different approach to cache node modules
Browse files Browse the repository at this point in the history
  • Loading branch information
richrace committed Sep 5, 2024
1 parent 8243717 commit 3aaad6d
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,24 @@ commands:
name: Clone bichard7-next-core
command: git clone --depth 1 https://github.com/ministryofjustice/bichard7-next-core.git ~/bichard7-next-core

install_npm_packages:
steps:
- restore_cache:
name: Load node_modules from the cache if they haven't changed
keys:
- v1-npm-deps-{{ .Branch }}-{{ checksum "package-lock.json" }}
- v1-npm-deps-
- run:
name: Install npm dependencies
command: npm i
- save_cache:
key: v1-npm-deps-{{ .Branch }}-{{ checksum "package-lock.json" }}
paths: node_modules
setup:
steps:
- checkout
- node_install
- node/install-packages:
include-branch-in-cache-key: true
cache-path: ~/project/node_modules
- install_npm_packages
- checkout_core
- run:
name: Set GB locale
Expand Down Expand Up @@ -179,8 +190,7 @@ jobs:
steps:
- checkout
- node_install
- node/install-packages:
include-branch-in-cache-key: true
- install_npm_packages
- run:
name: Check the code for linting errors
command: npm run lint
Expand All @@ -192,8 +202,7 @@ jobs:
steps:
- checkout
- node_install
- node/install-packages:
include-branch-in-cache-key: true
- install_npm_packages
- run:
name: Run code-based unit tests
command: npm run test:unit
Expand Down Expand Up @@ -246,8 +255,7 @@ jobs:
- checkout_core
- install_ms_edge
- node_install
- node/install-packages:
include-branch-in-cache-key: true
- install_npm_packages
- run:
name: Install Cypress
command: ./.circleci/scripts/install-cypress.sh 2>&1
Expand Down

0 comments on commit 3aaad6d

Please sign in to comment.