ci: install all dependencies in build step to avoid hoisting issue (more visible with Yarn 2)

This commit is contained in:
Gaëtan Maisse 2021-02-11 08:48:47 +01:00
parent eb9d311cfe
commit cb6c9f01a2
No known key found for this signature in database
GPG Key ID: D934C0EF3714A8A8

View File

@ -81,9 +81,6 @@ jobs:
steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- run:
name: Remove examples
command: rm -rf examples/
- restore_cache:
name: Restore Yarn cache
keys:
@ -102,60 +99,12 @@ jobs:
- persist_to_workspace:
root: .
paths:
- examples
- node_modules
- addons
- dev-kits
- app
- lib
install-examples-deps:
executor:
class: medium
name: sb_node_10_classic
steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- restore_cache:
name: Restore Yarn cache
keys:
- install-examples-deps-yarn-cache-v4--{{ checksum "yarn.lock" }}
- run:
name: Install dependencies
command: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
- save_cache:
name: Save Yarn cache
key: install-examples-deps-yarn-cache-v4--{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- persist_to_workspace:
root: .
paths:
- examples
- node_modules
install-e2e-deps:
executor:
class: small
name: sb_node_10_classic
steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- run:
name: Keep only root package
command: rm -rf examples/ && rm -rf addons/ && rm -rf app/ && rm -rf lib/
- restore_cache:
name: Restore cached node_modules
keys:
- install-e2e-deps-node_modules-cache-v1--{{ checksum "yarn.lock" }}
- run:
name: Install dependencies if cache wasn't hit
command: "[ ! -d \"node_modules/\" ] && yarn install --frozen-lockfile || echo \"Skipping yarn install\""
- save_cache:
name: Save node_modules
key: install-e2e-deps-node_modules-cache-v1--{{ checksum "yarn.lock" }}
paths:
- node_modules
- persist_to_workspace:
root: .
paths:
- node_modules
chromatic:
executor: sb_node_10_browsers
parallelism: 4
@ -512,30 +461,23 @@ workflows:
test:
jobs:
- build
- install-e2e-deps
- install-examples-deps
- lint:
requires:
- install-examples-deps
- build
- examples:
requires:
- install-examples-deps
- build
- e2e-tests-examples:
requires:
- examples
- smoke-tests:
requires:
- install-examples-deps
- build
- packtracker:
requires:
- install-examples-deps
- build
- unit-tests:
requires:
- install-examples-deps
- build
- coverage:
requires:
@ -545,7 +487,6 @@ workflows:
- examples
- publish:
requires:
- install-e2e-deps
- build
- e2e-tests-node-10:
requires: