I’m trying to install dependencies and build my app first, save the cache then run all tests in parellel after build is completed.
Based on this from the docs: https://circleci.com/docs/2.0/sample-config/#sample-configuration-with-sequential-workflow
I’ve been trying to get this to work but the node modules or output from my yarn build
command are not present.
and this now closed issue: Node js Sequential Workflow example is not working
Can the docs be updated to reflect the required persist_to_workspace
option for this to work?
My config for reference:
jobs:
build:
docker:
- image: circleci/node:10-browsers
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package.json" }}
- run:
command: 'yarn install'
name: 'Install dependencies'
- run:
command: 'yarn run build:app'
name: 'Build app'
- save_cache:
key: v2-dependencies-{{ checksum "package.json" }}
paths:
- node_modules
- public/
lighthouse:
docker:
- image: circleci/node:10-browsers
steps:
- checkout
- run:
command: npm run test:lighthouse
name: Lighthouse
lint:
docker:
- image: circleci/node:10
steps:
- checkout
- run: 'yarn lint'
snapshots:
docker:
- image: circleci/node:10
steps:
- checkout
- run:
command: npm run test:snapshots
name: Snapshots
testcafe:
docker:
- image: circleci/node:10-browsers
steps:
- checkout
- run:
command: npm run test:e2e
name: Testcafe
- store_artifacts:
path: ~/artifacts/screenshots
version: 2
workflows:
build_and_test:
jobs:
- build
- lint:
requires:
- build
- lighthouse:
requires:
- build
- snapshots:
requires:
- build
- testcafe:
requires:
- build
version: 2