Skip to content

Commit

Permalink
chore(coverage): Add codeclimate coverage report
Browse files Browse the repository at this point in the history
- Run codeclimate test coverage after passing the tests from circleci

[Finishes #161966566]
  • Loading branch information
SilasKenneth committed Jan 10, 2019
1 parent 9874b02 commit cf30f2e
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 3 deletions.
39 changes: 39 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: 2

defaults: &defaults
working_directory: ~/repo

jobs:
build:
docker:
- image: circleci/node:11.6.0

steps:
- checkout

- run:
name: 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:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: install-pee-wee
command: npm install

key: dependency-cache-{{ checksum "package.json" }}
paths:
- ./node_modules

- run:
name: Run Test and Coverage
command: |
./cc-test-reporter before-build
npm test
./cc-test-reporter after-build --exit-code $?
branches:
only:
- ch-codeclimate-setup-161966566
- develop
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.idea/
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ah-technocrats-frontend

[![Build Status](https://travis-ci.org/andela/ah-technocrats-frontend.svg?branch=develop)](https://travis-ci.org/andela/ah-technocrats-frontend)
[![Maintainability](https://api.codeclimate.com/v1/badges/c5fb742348ae4fabdf13/maintainability)](https://codeclimate.com/github/andela/ah-technocrats-frontend/maintainability)
[![Coverage Status](https://coveralls.io/repos/github/andela/ah-technocrats-frontend/badge.svg?branch=develop)](https://coveralls.io/github/andela/ah-technocrats-frontend?branch=develop)
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"test": "react-scripts test --coverage",
"eject": "react-scripts eject",
"coveralls": "cat ./coverage/lcov.info | node node_modules/.bin/coveralls",
"coverage": "yarn test --coverage"
},
"eslintConfig": {
"extends": "react-app"
Expand All @@ -25,6 +27,7 @@
"not op_mini all"
],
"devDependencies": {
"coveralls": "^3.0.2",
"eslint": "^5.6.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.14.0",
Expand Down

0 comments on commit cf30f2e

Please sign in to comment.