Skip to content

Commit

Permalink
Add codecov to CI (morganstanley#169)
Browse files Browse the repository at this point in the history
* Add codecov to CI

* Coverage for .NET

* Generate coverage to composeui-messaging-client

* set target to 100%
  • Loading branch information
kruplm authored Mar 9, 2023
1 parent fc4acb1 commit edb6a47
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 45 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/continuous-integration-prototypes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: Get-ChildItem -Recurse -Include *.sln | ForEach-Object {dotnet build $_ --configuration Release --no-restore; if ($LASTEXITCODE -ne 0 ) {throw "Build for $_ FAILED"; }}

- name: Test .Net
run: Get-ChildItem -Recurse -Include *.sln | ForEach-Object {dotnet test $_ --no-restore --verbosity normal}
run: Get-ChildItem -Recurse -Include *.sln | ForEach-Object {dotnet test $_ --no-restore --verbosity normal --collect:"XPlat Code Coverage"}


- name: Setup Node.js ${{ matrix.node-version }}
Expand All @@ -45,4 +45,7 @@ jobs:
run: npx lerna run build

- name: Test JavaScript
run: npx lerna run test
run: npx lerna run test

- name: Codecov
uses: codecov/[email protected]
1 change: 1 addition & 0 deletions Tryouts/Messaging-JS/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist/
node_modules/
coverage/
25 changes: 25 additions & 0 deletions Tryouts/Messaging-JS/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/

export default {
// Automatically clear mock calls, instances, contexts and results before every test
clearMocks: true,

// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,

// The directory where Jest should output its coverage files
coverageDirectory: "coverage",

// Indicates which provider should be used to instrument code for coverage
coverageProvider: "v8",

// A preset that is used as a base for Jest's configuration
preset: "ts-jest/presets/default-esm",
setupFilesAfterEnv: [
"./testSetup.ts"
]
};

41 changes: 0 additions & 41 deletions Tryouts/Messaging-JS/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,46 +36,5 @@
"dependencies": {
"@types/node": "^18.11.18",
"rxjs": "^7.8.0"
},
"jest": {
"preset": "ts-jest/presets/default-esm",
"setupFilesAfterEnv": [
"./testSetup.ts"
]
},
"dependenciesMeta": {
"@jest/[email protected]": {
"unplugged": true
},
"@rollup/[email protected]": {
"unplugged": true
},
"@types/[email protected]": {
"unplugged": true
},
"[email protected]": {
"unplugged": true
},
"[email protected]": {
"unplugged": true
},
"[email protected]": {
"unplugged": true
},
"[email protected]": {
"unplugged": true
},
"[email protected]": {
"unplugged": true
},
"[email protected]": {
"unplugged": true
},
"[email protected]": {
"unplugged": true
},
"[email protected]": {
"unplugged": true
}
}
}
6 changes: 4 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ coverage:

status:
project: yes
patch: no
patch:
default:
target: 100%
changes: no

comment:
layout: "diff, flags, files"
layout: "reach, diff, flags, files"

0 comments on commit edb6a47

Please sign in to comment.