Skip to content

Commit 4a428ed

Browse files
authored
Merge pull request #16 from UiPath/feature/configure_code_climate
Feature / Configure Code Climate
2 parents d86bbb7 + 9b22fb8 commit 4a428ed

File tree

3 files changed

+34
-7
lines changed

3 files changed

+34
-7
lines changed

.codeclimate.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
exclude_patterns:
2+
- '**/test/'
3+
- '**/tests/'
4+
- '**/*.spec.ts'
5+
- '**/*.d.ts'
6+
- '**/node_modules/'

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
Library of Angular components, directives, pipes, services or any other common stuff accros Angular apps in UiPath.
44

55
[![Build Status](https://uipath.visualstudio.com/angular-components/_apis/build/status/UiPath.angular-components?branchName=master)](https://uipath.visualstudio.com/angular-components/_build/latest?definitionId=387&branchName=master)
6+
[![Test Coverage](https://api.codeclimate.com/v1/badges/61117dc99c96535bbfb2/test_coverage)](https://codeclimate.com/github/UiPath/angular-components/test_coverage)
7+
[![Maintainability](https://api.codeclimate.com/v1/badges/61117dc99c96535bbfb2/maintainability)](https://codeclimate.com/github/UiPath/angular-components/maintainability)
68

79
## Documentation
810

azure-pipelines.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,49 @@
55

66
trigger:
77
- master
8+
- feature/*
9+
- fix/*
810

911
pool:
1012
vmImage: 'ubuntu-latest'
1113

1214
steps:
15+
- script: |
16+
echo '##vso[task.setvariable variable=VSTS_REGISTRY_TOKEN]$(system.registryToken)'
17+
echo '##vso[task.setvariable variable=CC_TEST_REPORTER_ID]$(system.ccToken)'
18+
echo '##vso[task.setvariable variable=GIT_COMMIT_SHA]$(Build.SourceVersion)'
19+
echo '##vso[task.setvariable variable=GIT_BRANCH]$(Build.SourceBranchName)'
20+
displayName: 'Configure Environment Variables'
21+
22+
- script: |
23+
echo $(GIT_COMMIT_SHA)
24+
echo $(GIT_BRANCH)
25+
displayName: 'Echo Commit SHA and Branch'
26+
1327
- task: NodeTool@0
1428
inputs:
1529
versionSpec: '10.x'
1630
displayName: 'Install Node.js'
1731

1832
- script: |
19-
npm i
20-
env:
21-
VSTS_REGISTRY_TOKEN: $(system.registryToken)
33+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
34+
chmod +x ./cc-test-reporter
35+
./cc-test-reporter before-build -d
36+
displayName: 'Hook Code Climate Coverage Status'
37+
38+
- script: |
39+
npm ci
2240
displayName: 'Install NPM Dependencies'
2341

2442
- script: |
2543
npm run test:coverage
26-
env:
27-
VSTS_REGISTRY_TOKEN: $(system.registryToken)
2844
displayName: 'Run Tests and Generate Coverage Report'
2945

46+
- script: |
47+
./cc-test-reporter format-coverage -d -t lcov ./coverage/lcov.info
48+
./cc-test-reporter upload-coverage -d
49+
displayName: 'Publish LCOV result to Code Climate'
50+
3051
- task: PublishTestResults@2
3152
inputs:
3253
testResultsFormat: 'JUnit'
@@ -37,6 +58,4 @@ steps:
3758
- script: |
3859
npm run build:prod
3960
npm run build:theme
40-
env:
41-
VSTS_REGISTRY_TOKEN: $(system.registryToken)
4261
displayName: 'Bundle Library'

0 commit comments

Comments
 (0)