Skip to content

Commit

Permalink
ci(codecov): fix code coverage (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpierre74 authored Mar 20, 2022
1 parent 115e63a commit b97828e
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 20 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ jobs:
- run: yarn install --frozen-lockfile --non-interactive --no-progress --prefer-offline
- run: npx nx affected --target=lint --parallel --max-parallel=3
- run: npx nx affected --target=build --parallel --max-parallel=3
- run: npx nx affected --target=test --parallel --max-parallel=2
- run: npx nx affected --target=test --parallel --max-parallel=2 --code-coverage
- run: npx nx affected --target=e2e --parallel --max-parallel=2

# - name: Codecov upload
# uses: codecov/codecov-action@v2
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
- name: Codecov upload
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}

pr:
runs-on: ubuntu-latest
Expand All @@ -54,11 +54,11 @@ jobs:
- run: yarn install --frozen-lockfile --non-interactive --no-progress --prefer-offline
- run: npx nx affected --base=origin/master --target=lint --parallel --max-parallel=3
- run: npx nx affected --base=origin/master --target=build --parallel --max-parallel=3
- run: npx nx affected --base=origin/master --target=test --parallel --max-parallel=2 --coverage --outputFile=coverage-final.json --json
- run: npx nx affected --base=origin/master --target=test --parallel --max-parallel=2 --code-coverage
- run: npx nx affected --base=origin/master --target=e2e --parallel --max-parallel=2

# - name: Codecov upload
# uses: codecov/codecov-action@v2
# with:
# verbose: true
# token: ${{ secrets.CODECOV_TOKEN }}
- name: Codecov upload
uses: codecov/codecov-action@v2
with:
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ jobs:
- name: Build
run: yarn nx affected:build --base=last-release
- name: Unit tests
run: yarn nx affected:test --base=last-release
# - name: Codecov upload
# uses: codecov/codecov-action@v2
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
run: yarn nx affected:test --base=last-release --code-coverage
- name: Codecov upload
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}

release:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions apps/demo/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ module.exports = {
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/demo',
coverageReporters: ['html', 'lcov'],
};
35 changes: 31 additions & 4 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,22 @@ coverage:
round: down
status:
project:
builder:
target: 70%
form-builder:
target: 90%
flags:
- builder
- form-builder
form-redux:
target: 90%
flags:
- form-redux
form-context:
target: 90%
flags:
- form-context
form-validation-rule-list:
target: 90%
flags:
- form-validation-rule-list
patch:
default:
enabled: no
Expand All @@ -16,6 +28,21 @@ coverage:
enabled: no
if_not_found: success
flags:
builder:
form-builder:
paths:
- libs/form-builder/src
form-redux:
paths:
- libs/form-redux/src
form-context:
paths:
- libs/form-context/src
form-validation-rule-list:
paths:
- libs/form-validation-rule-list/src

ignore:
- "apps/demo/**/*"
- "apps/docsite/**/*"
- "libs/form-editor/**/*"
- "libs/examples/**/*"
1 change: 1 addition & 0 deletions libs/form-builder/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ module.exports = {
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/form-builder',
coverageReporters: ['html', 'lcov'],
};
1 change: 1 addition & 0 deletions libs/form-context/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ module.exports = {
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/form-context',
coverageReporters: ['html', 'lcov'],
};
1 change: 1 addition & 0 deletions libs/form-editor/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ module.exports = {
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/form-editor',
coverageReporters: ['html', 'lcov'],
};
1 change: 1 addition & 0 deletions libs/form-redux/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ module.exports = {
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/form-redux',
coverageReporters: ['html', 'lcov'],
};
1 change: 1 addition & 0 deletions libs/form-validation-rule-list/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ module.exports = {
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/form-validation-rule-list',
coverageReporters: ['html', 'lcov'],
};

0 comments on commit b97828e

Please sign in to comment.