Skip to content

Commit

Permalink
Minor readme improvements (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderLanin committed Nov 29, 2022
1 parent 85136c6 commit 072a74d
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions README.md
Expand Up @@ -29,25 +29,25 @@ You can add this action to your GitHub workflow for Ubuntu runners (e.g. runs-on

## 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 |
| `pytest-xml-coverage-path` | | '' | The location of coverage-xml from pytest-coverage (--cov-report "xml:coverage.xml) |
| `coverage-path-prefix` | | '' | Prefix for path when link to files in 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 |
| `report-only-changed-files` | | false | Show in report only changed files for this commit, and not all files |
| `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. |
| `hide-comment` | | false | Hide the whole comment (use when you need only the `output`). Useful for auto-update bagdes in readme. See the [workflow](../main/.github/workflows/live-test.yml) for example |
| `default-branch` | | `main` | This branch name is usefull when generate "coverageHtml", it points direct links to files on this branch (instead of commit).<br/>Usually "main" or "master" |
| `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. |
| `remove-link-from-badge` | | false | When true, it will remove the link from badge to readme |
| `unique-id-for-comment` | | '' | When running in a matrix, pass the matrix value, so each comment will be updated its own comment `unique-id-for-comment: ${{ matrix.python-version }}` |
| 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 determine coverage percentage |
| `pytest-xml-coverage-path` | | '' | The location of coverage-xml from pytest-coverage (--cov-report "xml:coverage.xml) |
| `coverage-path-prefix` | | '' | Prefix for path when link to files in 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 |
| `report-only-changed-files` | | false | Show in report only changed files for this commit, and not all files |
| `junitxml-path` | | '' | The location of the junitxml. Used to determine test numbers (passed, failed, etc) |
| `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. |
| `hide-comment` | | false | Hide the whole comment (use when you need only the `output`). Useful for auto-update bagdes in readme. See the [workflow](../main/.github/workflows/live-test.yml) for example |
| `default-branch` | | `main` | This branch name is usefull when generate "coverageHtml", it points direct links to files on this branch (instead of commit).<br/>Usually "main" or "master" |
| `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-junit.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. |
| `remove-link-from-badge` | | false | When true, it will remove the link from badge to readme |
| `unique-id-for-comment` | | '' | When running in a matrix, pass the matrix value, so each comment will be updated its own comment `unique-id-for-comment: ${{ matrix.python-version }}` |

## Output Variables

Expand Down Expand Up @@ -208,8 +208,8 @@ Example GitHub Action workflow that uses multiple files mode (see the [live work
uses: MishaKav/pytest-coverage-comment@main
with:
multiple-files: |
My Title 1, ./data/pytest-coverage_3.txt, ./data/pytest_1.xml
My Title 2, ./data/pytest-coverage_4.txt, ./data/pytest_2.xml
My Title 1, ./data/pytest-coverage_3.txt, ./data/pytest_junit_1.xml
My Title 2, ./data/pytest-coverage_4.txt, ./data/pytest_junit_2.xml
```

Example GitHub Action workflow that will update your `README.md` with coverage report, only on merge to `main` branch (see the [update-coverage-on-readme workflow](../main/.github/workflows/update-coverage-on-readme.yml))
Expand Down

0 comments on commit 072a74d

Please sign in to comment.