Skip to content

Commit a0b5a16

Browse files
Fixing two upload for codeclimate test coverage reporter
1 parent 6efdb4a commit a0b5a16

File tree

3 files changed

+51
-32
lines changed

3 files changed

+51
-32
lines changed

Diff for: .circleci/config.yml

+35-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
version: 2.1
22

3-
43
orbs:
54
node: circleci/[email protected]
6-
coveralls: coveralls/[email protected]
75

86
executors:
97
node-executor:
@@ -13,26 +11,58 @@ executors:
1311
jobs:
1412
build:
1513
executor: node-executor
14+
environment:
15+
CC_TEST_REPORTER_ID: b996f145a438f80141cfcc86bb35a2c212a2a24c394abee18da6add05eaaee7e
1616
steps:
1717
- checkout
1818
- run: npm install
19+
20+
- run:
21+
name: Install Code Climate test reporter
22+
command: |
23+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
24+
chmod +x ./cc-test-reporter
25+
- run:
26+
name: Initialize Code Climate test reporter
27+
command: ./cc-test-reporter before-build
1928
- run:
20-
name: Run Tests
21-
command: npm test
29+
name: Run Tests with Coverage
30+
command: npx nyc npm run test:coverage
31+
- run:
32+
name: Format Coverage Report
33+
command: npx nyc report --reporter=text-lcov > coverage.lcov
34+
- run:
35+
name: Upload Coverage Report to Code Climate
36+
command : |
37+
./cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.json coverage.lcov
38+
./cc-test-reporter upload-coverage
39+
when: always
40+
- store_artifacts: # upload test coverage as artifact
41+
path: ./coverage/lcov.info
42+
2243

2344
deploy:
2445
executor: node-executor
2546
steps:
47+
2648
- checkout
49+
- run: npm install
50+
- run:
51+
name: Install TypeScript
52+
command: sudo npm install -g typescript
2753
- run:
2854
name: Build Project
29-
command: tsc
55+
56+
command: npx tsc
57+
58+
3059
- run:
3160
name: Compile TypeScript
3261
command: ./node_modules/.bin/tsc
3362

3463

3564

65+
3666
workflows:
3767
version: 2
3868
build_and_deploy:

Diff for: .codeclimate.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
version: "2"
32
checks:
43
argument_count:
@@ -9,6 +8,8 @@ checks:
98
enabled: true
109
return_count:
1110
enabled: true
11+
similar_code:
12+
enabled: false
1213

1314
exclude_paths:
1415
- "node_modules/**"
@@ -29,5 +30,5 @@ ratings:
2930

3031
test_reporter:
3132
id: "cc-test-reporter"
32-
coverage_file:
33-
- "coverage/lcov.info"
33+
coverage_files:
34+
- "coverage/lcov.info"

Diff for: .hound.yml

+12-24
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
1-
# Example .hound.yml for a Node.js, Express, Postgres, and React on our e-commerce project
2-
eslint:
3-
enabled: true
4-
config_file: .eslintrc.json
5-
ignore_file: .eslintignore
6-
7-
jscs:
8-
enabled: true
9-
config_file: .jscsrc
10-
11-
npm:
12-
enabled: true
13-
14-
# React specific rules
15-
react:
16-
enabled: true
17-
jsx_file_extensions:
18-
- ".jsx"
19-
- ".tsx"
20-
21-
# SQL linting
22-
eslint_sql:
23-
enabled: true
24-
config_file: .eslintrc-sql.json
1+
linters:
2+
eslint:
3+
enabled: true
4+
config_file: .eslintrc
5+
file_patterns:
6+
- '*.js'
7+
- '*.ts'
8+
enabled_plugins:
9+
- eslint-plugin-react
10+
- eslint-plugin-import
11+
- eslint-plugin-prettier
12+
- eslint-plugin:@typescript-eslintnp

0 commit comments

Comments
 (0)