From d169f151cd9a614fafd185821812c47a0a82d58f Mon Sep 17 00:00:00 2001 From: kumavis Date: Fri, 26 Mar 2021 11:55:03 +0800 Subject: [PATCH] ci - cache deps before patch-package (#10735) * ci - cache deps before patch-package * ci - bump dep cache number (cache break) --- .circleci/config.yml | 8 ++++++-- .circleci/scripts/deps-install.sh | 2 +- package.json | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 908ef7722..4955fe38f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -135,16 +135,20 @@ jobs: steps: - checkout - restore_cache: - key: dependency-cache-{{ checksum "yarn.lock" }} + key: dependency-cache-v1-{{ checksum "yarn.lock" }} - run: name: Install deps command: | .circleci/scripts/deps-install.sh - save_cache: - key: dependency-cache-{{ checksum "yarn.lock" }} + key: dependency-cache-v1-{{ checksum "yarn.lock" }} paths: - node_modules/ - build-artifacts/yarn-install-har/ + - run: + name: Postinstall + command: | + yarn setup:postinstall - persist_to_workspace: root: . paths: diff --git a/.circleci/scripts/deps-install.sh b/.circleci/scripts/deps-install.sh index eaab9f2de..7ea3da9cb 100755 --- a/.circleci/scripts/deps-install.sh +++ b/.circleci/scripts/deps-install.sh @@ -5,7 +5,7 @@ set -x # Exit immediately if a command exits with a non-zero status. set -e -yarn setup-ci +yarn install --frozen-lockfile --har # Move HAR file into directory with consistent name so that we can cache it mkdir -p build-artifacts/yarn-install-har diff --git a/package.json b/package.json index a3cb1f318..23f92a21e 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "version": "0.0.0", "private": true, "scripts": { - "setup": "yarn install && yarn patch-package && yarn allow-scripts", - "setup-ci": "yarn install --frozen-lockfile --har && yarn patch-package && yarn allow-scripts", + "setup": "yarn install && yarn setup:postinstall", + "setup:postinstall": "yarn patch-package && yarn allow-scripts", "start": "node development/build/index.js dev", "start:lavamoat": "yarn build dev", "dist": "yarn build prod",