Skip to content

Commit

Permalink
more work fixing test pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
dkhunt27 committed Feb 4, 2022
1 parent 7707cea commit 177bcb8
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 34 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
- uses: ./
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
no-coverage-ran: false
coverage-folder: ./__tests__/data/coverage
coverage-base-folder: ./__tests__/data/coverage-base
gist-token: ${{ secrets.COVERAGE_BADGE_GIST_TOKEN }}
Expand Down
63 changes: 32 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# action-nx-code-coverage

This is a github action for combining/compiling code coverage from an nx monorepo (although will probably work for other mono/single repos).
- This will loop through the coverage folder which should contain all the projects and their coverage results.
- On a PR execution, this will update the PR with a PR Commit displaying the coverage results for those projects
- On a push execution, this will update coverage badges for all projects (using the gist method specified [here](https://dev.to/thejaredwilcurt/coverage-badge-with-github-actions-finally-59fa)

> [GitHub Action](https://help.github.com/en/actions) to combine/compile code coverage from an nx monorepo
- This will loop through the coverage folder which should contain all the projects and their coverage results.
- On a PR execution, this will update the PR with a PR Commit displaying the coverage results for those projects
- On a push execution, this will update coverage badges for all projects (using the gist method specified [here](https://dev.to/thejaredwilcurt/coverage-badge-with-github-actions-finally-59fa)

> [GitHub Action](https://help.github.com/en/actions) to combine/compile code coverage from an nx monorepo
-  Code coverage comment for monorepo
-  Code coverage diff if base provided
-  Updates the Code coverage comment instead of adding new
- Code coverage comment for monorepo
- Code coverage diff if base provided
- Updates the Code coverage comment instead of adding new

The report is based on the coverage report generated by your test runner.

## Inputs

```yaml
inputs:
github-token:
required: true
description: Github token
Expand All @@ -24,19 +26,16 @@ inputs:
type: boolean
coverage-folder:
required: false
description: path to folder containing project folders with coverage data
description: path to folder containing project folders with coverage data (default 'coverage')
coverage-base-folder:
required: false
description: path to folder containing project folders with coverage data for diff/base comparison
description: path to folder containing project folders with coverage data for diff/base comparison (default 'coverage-base')
gist-token:
description: 'Your secret with the gist scope for coverage badge'
required: true
gist-id:
description: 'The ID of the gist to use'
required: true
filename:
description: 'The *.json filename of the badge data'
required: true
label-color:
description: 'The left color of the badge'
required: false
Expand Down Expand Up @@ -70,9 +69,11 @@ inputs:
```
## Setup
- Perform gist setup from https://dev.to/thejaredwilcurt/coverage-badge-with-github-actions-finally-59fa
- Perform gist setup from [link](https://dev.to/thejaredwilcurt/coverage-badge-with-github-actions-finally-59fa)
- Must run nx:affected test --coverage so the coverage results already exist
```
```yaml
- name: Comment Code Coverage on PR
uses: dkhunt27/nx-code-coverage@v0.3.0
with:
Expand All @@ -84,35 +85,35 @@ inputs:
color: green
named-logo: jest
```
- See sample workflows
- See sample workflows
- [main-push.yaml](./.github/samples/main-push.yaml)
- [pull-request.yaml](./.github/samples/pull-request.yaml)
## Making changes and pushing releases
+ wait for pipelines to finish
+ git checkout main
+ git pull
+ git tag v0.3.0
+ SKIP_HOOKS=true git push origin v0.3.0
+ in github, edit tag and save (this will push to marketplace)
- wait for pipelines to finish
- git checkout main
- git pull
- git tag v0.3.0
- SKIP_HOOKS=true git push origin v0.3.0
- in github, edit tag and save (this will push to marketplace)
## NPM Check
```
```bash
npm run npm:check
```

## Acknowledgements
Thanks to the creators of the code that this was based on

- [eeshdarthvader/code-coverage-assistant](https://github.com/eeshdarthvader/code-coverage-assistant)
- [romeovs/lcov-reporter-action](https://github.com/romeovs/lcov-reporter-action).
- [ziishaned/jest-reporter-action](https://github.com/ziishaned/jest-reporter-action)
- [slavcodev/coverage-monitor-action](https://github.com/slavcodev/coverage-monitor-action)
Thanks to the creators of the code that this was based on

- [eeshdarthvader/code-coverage-assistant](https://github.com/eeshdarthvader/code-coverage-assistant)
- [romeovs/lcov-reporter-action](https://github.com/romeovs/lcov-reporter-action).
- [ziishaned/jest-reporter-action](https://github.com/ziishaned/jest-reporter-action)
- [slavcodev/coverage-monitor-action](https://github.com/slavcodev/coverage-monitor-action)

## License

[MIT](LICENSE)


3 changes: 0 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ inputs:
gist-id:
description: 'The ID of the gist to use'
required: true
filename:
description: 'The *.json filename of the badge data'
required: true
label-color:
description: 'The left color of the badge'
required: false
Expand Down

0 comments on commit 177bcb8

Please sign in to comment.