-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* @vercel/ncc minor update * fix error when comment body is too long (#15) * update verstion to 1.1.5 * add explanation image to README
- Loading branch information
Showing
7 changed files
with
82 additions
and
50 deletions.
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 |
---|---|---|
|
@@ -10,7 +10,7 @@ jobs: | |
|
||
- name: Pytest coverage comment | ||
id: coverageComment | ||
uses: MishaKav/[email protected].4 | ||
uses: MishaKav/[email protected].5 | ||
with: | ||
pytest-coverage-path: ./data/pytest-coverage_4.txt | ||
junitxml-path: ./data/pytest_1.xml | ||
|
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ jobs: | |
- uses: actions/checkout@v2 | ||
|
||
- name: Pytest coverage comment | ||
uses: MishaKav/[email protected].4 | ||
uses: MishaKav/[email protected].5 | ||
with: | ||
multiple-files: | | ||
My Title 1, ./data/pytest-coverage_3.txt, ./data/pytest_1.xml | ||
|
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 |
---|---|---|
|
@@ -8,25 +8,25 @@ You can add this action to your GitHub workflow for Ubuntu runners (e.g. runs-on | |
|
||
```yaml | ||
- name: Pytest coverage comment | ||
uses: MishaKav/[email protected].4 | ||
uses: MishaKav/[email protected].5 | ||
with: | ||
pytest-coverage-path: ./pytest-coverage.txt | ||
junitxml-path: ./pytest.xml | ||
``` | ||
## Inputs | ||
| Name | Required | Default | Description | | ||
| ---------------------- | -------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `github-token` | ✓ | `${{github.token}}` | An alternative GitHub token, other than the default provided by GitHub Actions runner | | ||
| `pytest-coverage-path` | | `./pytest-coverage.txt` | The location of the txt output of pytest-coverage. Used to generate the comment | | ||
| `title` | | `Coverage Report` | Title for the coverage report. Useful for monorepo projects | | ||
| `badge-title` | | `Coverage` | Title for the badge icon | | ||
| `hide-badge` | | false | Hide badge with percentage | | ||
| `hide-report` | | false | Hide coverage report | | ||
| `junitxml-path` | | '' | The location of the junitxml path | | ||
| `junitxml-title` | | '' | Title for summary for junitxml | | ||
| `create-new-comment` | | false | When false, will update the same comment, otherwise will publish new comment on each run. | | ||
| Name | Required | Default | Description | | ||
| ---------------------- | -------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `github-token` | ✓ | `${{github.token}}` | An alternative GitHub token, other than the default provided by GitHub Actions runner | | ||
| `pytest-coverage-path` | | `./pytest-coverage.txt` | The location of the txt output of pytest-coverage. Used to generate the comment | | ||
| `title` | | `Coverage Report` | Title for the coverage report. Useful for monorepo projects | | ||
| `badge-title` | | `Coverage` | Title for the badge icon | | ||
| `hide-badge` | | false | Hide badge with percentage | | ||
| `hide-report` | | false | Hide coverage report | | ||
| `junitxml-path` | | '' | The location of the junitxml path | | ||
| `junitxml-title` | | '' | Title for summary for junitxml | | ||
| `create-new-comment` | | false | When false, will update the same comment, otherwise will publish new comment on each run. | | ||
| `multiple-files` | | '' | You can pass array of titles and files to generate single comment with table of results.<br/>Single line should look like `Title, ./path/to/pytest-coverage.txt, ./path/to/pytest.xml`<br/> example:<br/> `My Title 1, ./data/pytest-coverage_3.txt, ./data/pytest_1.xml`<br/>**Note:** In that mode the `output` for `coverage` and `color` will be for the first file only. | | ||
|
||
## Output example | ||
|
@@ -71,7 +71,7 @@ jobs: | |
pytest --junitxml=pytest.xml --cov=app tests/ | tee pytest-coverage.txt | ||
- name: Pytest coverage comment | ||
uses: MishaKav/[email protected].4 | ||
uses: MishaKav/[email protected].5 | ||
with: | ||
pytest-coverage-path: ./pytest-coverage.txt | ||
junitxml-path: ./pytest.xml | ||
|
@@ -82,7 +82,7 @@ Example GitHub Action workflow that uses coverage percentage as output (see the | |
```yaml | ||
- name: Pytest coverage comment | ||
id: coverageComment | ||
uses: MishaKav/[email protected].4 | ||
uses: MishaKav/[email protected].5 | ||
with: | ||
pytest-coverage-path: ./pytest-coverage.txt | ||
junitxml-path: ./pytest.xml | ||
|
@@ -97,7 +97,7 @@ Example GitHub Action workflow that passes all params to Pytest Coverage Comment | |
|
||
```yaml | ||
- name: Pytest coverage comment | ||
uses: MishaKav/[email protected].4 | ||
uses: MishaKav/[email protected].5 | ||
with: | ||
pytest-coverage-path: ./path-to-file/pytest-coverage.txt | ||
title: My Coverage Report Title | ||
|
@@ -109,6 +109,8 @@ Example GitHub Action workflow that passes all params to Pytest Coverage Comment | |
junitxml-title: My JUnit Xml Summary Title | ||
``` | ||
|
||
![image](https://user-images.githubusercontent.com/289035/126039976-3f1bf8dd-5a6b-4103-8548-fc3eecc377d7.png) | ||
|
||
Example GitHub Action workflow that runs pytest inside **docker** | ||
It will generate `pytest-coverage.txt` and `pytest.xml` in `/tmp` directory inside docker and share `/tmp` directory with GitHub workspace. | ||
|
||
|
@@ -118,7 +120,7 @@ It will generate `pytest-coverage.txt` and `pytest.xml` in `/tmp` directory insi | |
docker run -v /tmp:/tmp $IMAGE_TAG python3 -m pytest --cov-report=term-missing:skip-covered --junitxml=/tmp/pytest.xml --cov=src tests/ | tee /tmp/pytest-coverage.txt | ||
- name: Pytest coverage comment | ||
uses: MishaKav/[email protected].4 | ||
uses: MishaKav/[email protected].5 | ||
with: | ||
pytest-coverage-path: /tmp/pytest-coverage.txt | ||
junitxml-path: /tmp/pytest.xml | ||
|
@@ -128,7 +130,7 @@ Example GitHub Action workflow that uses multiple files mode (see the [live work | |
|
||
```yaml | ||
- name: Pytest coverage comment | ||
uses: MishaKav/[email protected].4 | ||
uses: MishaKav/[email protected].5 | ||
with: | ||
multiple-files: | | ||
My Title 1, ./data/pytest-coverage_3.txt, ./data/pytest_1.xml | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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