Skip to content

Commit

Permalink
cache everything together
Browse files Browse the repository at this point in the history
  • Loading branch information
kira-m committed Nov 24, 2023
1 parent d6e9e27 commit 78e058f
Showing 1 changed file with 6 additions and 32 deletions.
38 changes: 6 additions & 32 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,14 @@ version: 2.1

references:
# the key used to pull FRONTEND npm dependencies from the cache
cache-key: &cache-key 'dishzero-{{checksum "package-lock.json"}}'
app-cache-key: &app-cache-key 'dishzero-app-{{checksum "app/package-lock.json"}}'
server-cache-key: &server-cache-key 'dishzero-server-{{checksum "backend/package-lock.json"}}'
cache-key: &cache-key 'dishzero-npm-{{checksum "package-lock.json"}}-{{checksum "app/package-lock.json"}}'

commands:
restore-app:
steps:
- restore_cache:
key: *app-cache-key

# restore-server:
# steps:
# - restore_cache:
# key: *server-cache-key

restore-all:
steps:
- restore_cache:
key: *cache-key
- restore_cache:
key: *app-cache-key
# - restore_cache:
# key: *server-cache-key


executors:
ci-node:
Expand All @@ -47,31 +32,20 @@ jobs:
- run:
name: "Install base dependencies"
command: npm install --include dev
- save_cache:
paths:
- node_modules
key: *cache-key
- run:
name: "Install frontend dependencies"
command: cd app && npm install --include dev
- save_cache:
paths:
- app/node_modules
key: *app-cache-key
# - run:
# name: "Install server dependencies"
# command: cd backend && npm install --include dev
# - save_cache:
# paths:
# - backend/node_modules
# key: *server-cache-key
paths: ["node_modules", "app/node_modules"]
key: *cache-key


# run eslint on frontend
lint-app:
executor: ci-node
steps:
- checkout
- restore-app
- restore-all
- run:
name: "Lint /app"
command: cd app && npm run lint-ci
Expand Down

0 comments on commit 78e058f

Please sign in to comment.