Skip to content

Commit

Permalink
Add CircleCI configuration
Browse files Browse the repository at this point in the history
Config copied from deck-of-cards
  • Loading branch information
j5bot committed Nov 9, 2018
1 parent 993db47 commit eb85f02
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
branches:
ignore:
- gh-pages

docker:
# specify the version you desire here
- image: circleci/node:7.10

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4

working_directory: ~/repo

steps:
- checkout

# Download and cache dependencies
- 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" }}

# run tests!
- run:
name: Run Tests/Coverage
command: npm run coverage

- run:
name: Update CodeCov.io based on coverage results
command: if [ $? -eq 0 ]; then bash <(curl -s https://codecov.io/bash); fi

- run:
name: Install JUnit coverage reporter
command: npm install --only=dev jest-junit

- run:
name: Make reports directory
command: mkdir -p reports

- run:
name: Run tests with JSON output
command: npm run coverage -- --json --outputFile=reports/js-test-results.json

- run:
environment:
JEST_JUNIT_OUTPUT: "reports/js-test-results.xml"
name: Run tests with JUnit as reporter
command: npm run test -- --runInBand --ci --reporters=default --reporters=jest-junit
when: always

# - run:
# name: Generate eslint report in JUnit format
# command: npm run lint -- --format junit -o reports/js-lint-results.xml
# when: always

- store_test_results:
path: reports
- store_artifacts:
path: reports

0 comments on commit eb85f02

Please sign in to comment.