.circleci/config.yml
version: 2
jobs:
build:
docker:
- image: circleci/node:8
steps:
- checkout
- restore_cache: # special step to restore the dependency cache
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Setup Dependencies
command: npm install
- run:
name: Setup Code Climate test-reporter
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- save_cache: # special step to save the dependency cache
key: dependency-cache-{{ checksum "package.json" }}
paths:
- ./node_modules
- run: # run tests
name: Run Test and Coverage
command: |
./cc-test-reporter before-build
npm test -- --coverage
./cc-test-reporter after-build --exit-code $?
- run:
name: Install Wait On and Cypress
command: npm install wait-on cypress
- run:
name: "Start server"
command: "npm start"