Skip to content

Commit

Permalink
fix: bump to v5 and update README (#1655)
Browse files Browse the repository at this point in the history
* fix: bump to v5 and update README

* Update README.md

* Update README.md

Co-authored-by: Joe Becher <[email protected]>

* Update README.md

---------

Co-authored-by: Joe Becher <[email protected]>
  • Loading branch information
thomasrockhu-codecov and drazisil-codecov authored Nov 19, 2024
1 parent 21f471b commit fb6775d
Showing 1 changed file with 47 additions and 35 deletions.
82 changes: 47 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ You can see their usage in the `action.yml` [file](https://github.com/codecov/co

## Usage

To integrate Codecov with your Actions pipeline, specify the name of this repository with a tag number (`@v4` is recommended) as a `step` within your `workflow.yml` file.
To integrate Codecov with your Actions pipeline, specify the name of this repository with a tag number (`@v5` is recommended) as a `step` within your `workflow.yml` file.

This Action also requires you to [provide an upload token](https://docs.codecov.io/docs/frequently-asked-questions#section-where-is-the-repository-upload-token-found-) from [codecov.io](https://www.codecov.io) (tip: in order to avoid exposing your token, [store it](https://docs.codecov.com/docs/adding-the-codecov-token#github-actions) as a `secret`).

Expand All @@ -60,13 +60,13 @@ Inside your `.github/workflows/workflow.yml` file:
```yaml
steps:
- uses: actions/checkout@main
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true # optional (default = false)
files: ./coverage1.xml,./coverage2.xml # optional
flags: unittests # optional
name: codecov-umbrella # optional
token: ${{ secrets.CODECOV_TOKEN }} # required
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true # optional (default = false)
```
Expand All @@ -75,7 +75,7 @@ The Codecov token can also be passed in via environment variables:
```yaml
steps:
- uses: actions/checkout@main
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true # optional (default = false)
files: ./coverage1.xml,./coverage2.xml # optional
Expand All @@ -92,7 +92,7 @@ steps:
For users with [OpenID Connect(OIDC) enabled](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect), the Codecov token is not necessary. You can use OIDC with the `use_oidc` argument as following.

```yaml
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
use_oidc: true
```
Expand All @@ -105,38 +105,50 @@ Codecov's Action supports inputs from the user. These inputs, along with their d

| Input | Description | Required |
| :--- | :--- | :---: |
| `token` | Repository Codecov token. Used to authorize report uploads | *Required
| `codecov_yml_path` | Specify the path to the Codecov YML | Optional
| `commit_parent` | Override to specify the parent commit SHA | Optional
| `directory` | Directory to search for coverage reports. | Optional
| `disable_search` | Disable search for coverage files. This is helpful when specifying what files you want to upload with the --file option. | Optional
| `disable_file_fixes` | Disable file fixes to ignore common lines from coverage (e.g. blank lines or empty brackets) | Optional
| `binary` | The file location of a pre-downloaded version of the CLI. If specified, integrity checking will be bypassed. | Optional
| `codecov_yml_path` | The location of the codecov.yml file. This is crrently ONLY used for automated test selection (https://docs.codecov.com/docs/getting-started-with-ats). Note that for all other cases, the Codecov yaml will need to be locate
d as described here: https://docs.codecov.com/docs/codecov-yaml#can-i-name-the-file-codecovyml | Optional
| `commit_parent` | SHA (with 40 chars) of what should be the parent of this commit. | Optional
| `directory` | Folder to search for coverage files. Default to the current working directory | Optional
| `disable_file_fixes` | Disable file fixes to ignore common lines from coverage (e.g. blank lines or empty brackets). Read more here https://docs.codecov.com/docs/fixing-reports | Optional
| `disable_search` | Disable search for coverage files. This is helpful when specifying what files you want to upload with the files option. | Optional
| `disable_safe_directory` | Disable setting safe directory. Set to true to disable. | Optional
| `dry_run` | Don't upload files to Codecov | Optional
| `env_vars` | Environment variables to tag the upload with (e.g. PYTHON \| OS,PYTHON) | Optional
| `exclude` | Folders to exclude from search | Optional
| `fail_ci_if_error` | Specify whether or not CI build should fail if Codecov runs into an error during upload | Optional
| `file` | Path to coverage file to upload | Optional
| `files` | Comma-separated list of files to upload | Optional
| `flags` | Flag upload to group coverage metrics (e.g. unittests \| integration \| ui,chrome) | Optional
| `handle_no_reports_found` | Raise no exceptions when no coverage reports found | Optional
| `job_code` | The job code | Optional
| `name` | User defined upload name. Visible in Codecov UI | Optional
| `os` | Override the assumed OS. Options are linux \| macos \| windows \| . | Optional
| `override_branch` | Specify the branch name | Optional
| `override_build` | Specify the build number | Optional
| `exclude` | Comma-separated list of folders to exclude from search. | Optional
| `fail_ci_if_error` | On error, exit with non-zero code | Optional
| `files` | Comma-separated explicit list of files to upload. These will be added to the coverage files found for upload. If you wish to only upload the specified files, please consider using "disable-search" to disable uploading other files. | Optional
tional
| `flags` | Comma-separated list of flags to upload to group coverage metrics. | Optional
| `git_service` | Override the git_service (e.g. github_enterprise) | Optional
| `gcov_args` | Extra arguments to pass to gcov | Optional
| `gcov_executable` | gcov executable to run. Defaults to 'gcov' | Optional
| `gcov_ignore` | Paths to ignore during gcov gathering | Optional
| `gcov_include` | Paths to include during gcov gathering | Optional
| `handle_no_reports_found` | If no coverage reports are found, do not raise an exception. | Optional
| `job_code` | | Optional
| `name` | Custom defined name of the upload. Visible in the Codecov UI | Optional
| `network_filter` | Specify a filter on the files listed in the network section of the Codecov report. This will only add files whose path begin with the specified filter. Useful for upload-specific path fixing. | Optional
| `network_prefix` | Specify a prefix on files listed in the network section of the Codecov report. Useful to help resolve path fixing. | Optional
| `os` | Override the assumed OS. Options available at cli.codecov.io | Optional
| `override_branch` | Specify the branch to be displayed with this commit on Codecov | Optional
| `override_build` | Specify the build number manually | Optional
| `override_build_url` | The URL of the build where this is running | Optional
| `override_commit` | Specify the commit SHA | Optional
| `override_pr` | Specify the pull request number | Optional
| `plugin` | plugins to run. Options: xcode, gcov, pycoverage. The default behavior runs them all. | Optional
| `plugins` | Comma-separated list of plugins for use during upload. | Optional
| `report_code` | The code of the report. If unsure, do not include | Optional
| `root_dir` | Used to specify the location of your .git root to identify project root directory | Optional
| `slug` | Specify the slug manually (Enterprise use) | Optional
| `url` | Specify the base url to upload (Enterprise use) | Optional
| `use_legacy_upload_endpoint` | Use the legacy upload endpoint | Optional
| `use_oidc` | Use OpenID Connect for verification instead of token. This will ignore any token supplied. Please see [GitHub documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect) for details.
| `verbose` | Specify whether the Codecov output should be verbose | Optional
| `version` | Specify which version of the Codecov CLI should be used. Defaults to `latest` | Optional
| `override_commit` | Commit SHA (with 40 chars) | Optional
| `override_pr` | Specify the pull request number manually. Used to override pre-existing CI environment variables. | Optional
| `plugins` | Comma-separated list of plugins to run. Specify `noop` to turn off all plugins | Optional
| `report_code` | The code of the report if using local upload. If unsure, leave unset. Read more here https://docs.codecov.com/docs/the-codecov-cli#how-to-use-local-upload | Optional
| `report_type` | The type of file to upload, coverage by default. Possible values are "testing", "coverage". | Optional
| `root_dir` | Root folder from which to consider paths on the network section. Defaults to current working directory. | Optional
| `skip_validation` | Skip integrity checking of the CLI. This is NOT recommended. | Optional
| `slug` | [Required when using the org token] Set to the owner/repo slug used instead of the private repo token. Only applicable to some Enterprise users. | Optional
| `swift_project` | Specify the swift project name. Useful for optimization. | Optional
| `token` | Repository Codecov token. Used to authorize report uploads | Optional
| `url` | Set to the Codecov instance URl. Used by Dedicated Enterprise Cloud customers. | Optional
| `use_legacy_upload_endpoint` | Use the legacy upload endpoint. | Optional
| `use_oidc` | Use OIDC instead of token. This will ignore any token supplied | Optional
| `verbose` | Enable verbose logging | Optional
| `version` | Which version of the Codecov CLI to use (defaults to 'latest') | Optional
| `working-directory` | Directory in which to execute codecov.sh | Optional

### Example `workflow.yml` with Codecov Action
Expand Down Expand Up @@ -165,7 +177,7 @@ jobs:
pip install pytest-cov
pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
directory: ./coverage/reports/
env_vars: OS,PYTHON
Expand Down

0 comments on commit fb6775d

Please sign in to comment.