.circleci/config.yml
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2.1
jobs:
build:
docker:
- image: circleci/node:lts
working_directory: ~/repo
parallelism: 4
steps:
- checkout
- restore_cache:
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Install Dependencies
command: yarn install --frozen-lockfile
- save_cache:
name: Save Yarn Package Cache
key: yarn-packages-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- run:
name: Type-check
command: yarn run type-check
- run:
name: Test
command: yarn run test --ci --coverage --reporters=default --reporters=jest-junit
environment:
JEST_JUNIT_OUTPUT_DIR: ./reports/junit/
- 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
- run:
name: Collect test coverage
command: ./cc-test-reporter after-build -t lcov --debug
- run:
name: Build code
command: npm run build
- run:
name: Bundle code
command: npm run bundle
- store_test_results:
path: ./reports/junit/
- store_artifacts:
path: ./reports/junit/