Skip to content

Commit

Permalink
Enable codecov support (#312)
Browse files Browse the repository at this point in the history
- Create codecov.yml, add badge to readme
- Change flag management in codecov.yml
  • Loading branch information
mofojed authored Dec 3, 2021
1 parent d7fcd0b commit beffde3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,18 @@ jobs:
- name: Test (Pull Request)
if: ${{ github.event_name == 'pull_request' }}
run: |
npm run test:ci -- --changedSince origin/${{ github.event.pull_request.base.ref }}
npm run test:ci -- --changedSince origin/${{ github.event.pull_request.base.ref }} --collectCoverage=true
npm run test:golden-layout
- name: Test (Push)
if: ${{ github.event_name == 'push' }}
run: |
npm run test:ci -- --lastCommit
npm run test:golden-layout
- name: Codecov report
uses: codecov/codecov-action@v2
if: ${{ github.event_name == 'pull_request' }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unit
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

We're using a monorepo to manage our packages, as it becomes cumbersome to manage the overhead of multiple repos with how we wish to develop the Enterprise UI, while maintaining a separate OSS Code Studio solution. Using `lerna` to manage all of our packages in one repo simplifies the process.

[![codecov](https://codecov.io/gh/deephaven/web-client-ui/branch/main/graph/badge.svg?token=RW29S9X72C)](https://codecov.io/gh/deephaven/web-client-ui)

## Getting Started

We are still using node 14.x and npm 6.x. If you are [using nvm](https://github.com/nvm-sh/nvm#installing-and-updating), run `nvm install lts/fermium` to get the latest 14.x/6.x versions. Otherwise, download from the [node homepage](https://nodejs.org/en/download/).
Expand Down
3 changes: 3 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
flag_management:
default_rules:
carryforward: true
12 changes: 0 additions & 12 deletions jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,4 @@ module.exports = {
],
collectCoverage: false,
collectCoverageFrom: ['./src/**/*.{js,ts,jsx,tsx}'], // This is relative to individual project root due to how Jest handles it
coverageThreshold: {
// These global thresholds were taken as the baseline of the overall project when code coverage initiative began.
// In CI, these thresholds will be measures against only the files you have changed.
// We may want to increase/decrease the thresholds for specific projects, and we can do that:
// https://jestjs.io/docs/configuration#coveragethreshold-object
global: {
statements: 40,
branches: 30,
functions: 30,
lines: 40,
},
},
};

0 comments on commit beffde3

Please sign in to comment.