forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: code coverage configuration (aws#32079)
Leverage [Codecov](https://about.codecov.io/) to enforce (new) code coverage requirements. Resolves aws#31931 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Showing
5 changed files
with
106 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Codecov | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
collect: | ||
name: collect | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v4 | ||
|
||
- name: Install dependencies | ||
run: cd packages/aws-cdk && yarn install | ||
|
||
- name: Build CLI | ||
run: cd packages/aws-cdk && npx lerna run build --scope=aws-cdk | ||
|
||
- name: Run tests | ||
run: cd packages/aws-cdk && yarn test | ||
|
||
- name: Upload results to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
directory: packages/aws-cdk/coverage | ||
fail_ci_if_error: true | ||
flags: suite.unit | ||
token: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# https://docs.codecov.com/docs/codecovyml-reference#coverage | ||
coverage: | ||
status: | ||
project: | ||
default: | ||
# require the overall project coverage to never decrease | ||
target: auto | ||
patch: | ||
default: | ||
# require the overall patch coverage to be at least 95% | ||
target: 95 | ||
|
||
|
||
# https://docs.codecov.com/docs/codecovyml-reference#comment | ||
comment: | ||
layout: "header, diff, flags, components" | ||
|
||
# https://docs.codecov.com/docs/codecovyml-reference#component_management | ||
component_management: | ||
default_rules: | ||
statuses: | ||
# every component will produce its own status check that requires overall coverage doesnt decrease | ||
- type: project | ||
target: auto | ||
# every component will produce its own status check that requires patch coverage of at least 95% | ||
- type: patch | ||
target: 95 | ||
individual_components: | ||
- component_id: packages_aws_cdk # identifier that should not be changed | ||
name: packages/aws-cdk # display name that can change freely | ||
paths: | ||
- packages/aws-cdk/** |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters