.circleci/config.yml
version: 2
jobs:
build:
environment:
CC_TEST_REPORTER_ID: 4872a5231b1a8002e62a172925f58904d05be9bc5db9010f88c7e6536536293f
NODE_ENV: development
docker:
- image: circleci/node:11
steps:
- checkout
- run:
name: Setup CodeClimate test-reporter
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- restore_cache:
name: Restore node_modules cache
keys:
- v1-node-{{ arch }}-{{ .Branch }}
- v1-node-{{ arch }}-
- run:
name: Node.js version
command: node --version
- run:
name: Install dependencies
command: npm run install-all --no-save
- save_cache:
name: Save node_modules cache
key: v1-node-{{ arch }}-{{ .Branch }}
paths:
- node_modules
- packages/*/node_modules
- run:
name: Test
command: |
# Notify CodeClimate test reporter
./cc-test-reporter before-build
# Run tests
npm test
# Send coverage data
./cc-test-reporter after-build --coverage-input-type clover --exit-code $?
- run:
name: Run code linter
command: npm run lint