version: 2.0 jobs: install: docker: - image: circleci/node:10.2 working_directory: ~/repo steps: - checkout - restore_cache: keys: - v1-dependencies-{{ checksum "package.json" }} # fallback to using the latest cache if no exact match is found - v1-dependencies- - run: npm install - save_cache: paths: - node_modules key: v1-dependencies-{{ checksum "package.json" }} test: docker: - image: circleci/node:10.2 working_directory: ~/repo steps: - checkout - restore_cache: keys: - v1-dependencies-{{ checksum "package.json" }} # fallback to using the latest cache if no exact match is found - v1-dependencies- - run: name: Tests with coverage command: npm run test-ci - run: name: Install codecov command: npm i codecov - run: name: Submit coverage command: ./node_modules/.bin/codecov lint: docker: - image: circleci/node:10.2 working_directory: ~/repo steps: - checkout - restore_cache: keys: - v1-dependencies-{{ checksum "package.json" }} # fallback to using the latest cache if no exact match is found - v1-dependencies- - run: name: Lint command: npm run lint-ci workflows: version: 2 test_and_lint: jobs: - install - lint: requires: - install - test: requires: - install