Update README.md

This commit is contained in:
Tom Hu
2024-02-01 15:42:02 -08:00
committed by GitHub
parent 93b3dea0bf
commit 781907b2be

View File

@@ -1,6 +1,6 @@
# Codecov GitHub Action # Codecov GitHub Action
[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-v3-undefined.svg?logo=github&logoColor=white&style=flat)](https://github.com/marketplace/actions/codecov) [![GitHub Marketplace](https://img.shields.io/badge/Marketplace-v4-undefined.svg?logo=github&logoColor=white&style=flat)](https://github.com/marketplace/actions/codecov)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-action.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-action?ref=badge_shield) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-action.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-action?ref=badge_shield)
[![Workflow for Codecov Action](https://github.com/codecov/codecov-action/actions/workflows/main.yml/badge.svg)](https://github.com/codecov/codecov-action/actions/workflows/main.yml) [![Workflow for Codecov Action](https://github.com/codecov/codecov-action/actions/workflows/main.yml/badge.svg)](https://github.com/codecov/codecov-action/actions/workflows/main.yml)
### Easily upload coverage reports to Codecov from GitHub Actions ### Easily upload coverage reports to Codecov from GitHub Actions
@@ -8,9 +8,11 @@
## v4 Release ## v4 Release
`v4` of the Codecov GitHub Action will use the [Codecov CLI](https://github.com/codecov/codecov-cli) to upload coverage reports to Codecov. `v4` of the Codecov GitHub Action will use the [Codecov CLI](https://github.com/codecov/codecov-cli) to upload coverage reports to Codecov.
Breaking Changes ### Breaking Changes
- Tokenless uploading is unsupported. However, PRs made from forks to the upstream public repos will support tokenless (e.g. contributors to OS projects do not need the upstream repo's Codecov token) - Tokenless uploading is unsupported. However, PRs made from forks to the upstream public repos will support tokenless (e.g. contributors to OS projects do not need the upstream repo's Codecov token)
- Various arguments to the Action have been removed - Various arguments to the Action have been removed
### Dependabot
- For repositories using `Dependabot`, users will need to ensure that it has access to the Codecov token for PRs from Dependabot to upload coverage. - For repositories using `Dependabot`, users will need to ensure that it has access to the Codecov token for PRs from Dependabot to upload coverage.
`v3` versions and below will not have access to CLI features (e.g. global upload token, ATS). `v3` versions and below will not have access to CLI features (e.g. global upload token, ATS).
@@ -65,47 +67,40 @@ steps:
Codecov's Action supports inputs from the user. These inputs, along with their descriptions and usage contexts, are listed in the table below: Codecov's Action supports inputs from the user. These inputs, along with their descriptions and usage contexts, are listed in the table below:
| Input | Description | Usage | | Input | Description | Required |
| :---: | :---: | :---: | | :---: | :---: | :---: |
| `token` | Used to authorize coverage report uploads | *Required | | `token` | Repository Codecov token. Used to authorize report uploads | Optional
| `move_coverage_to_trash` | Move discovered coverage reports to the trash | Optional | `codecov_yml_path` | Specify the path to the Codecov YML | Optional
| `commit_parent` | The commit SHA of the parent for which you are uploading coverage. If not present, the parent will be determined using the API of your repository provider. When using the repository provider's API, the parent is determined via finding the closest ancestor to the commit. | Optional | `commit_parent` | Override to specify the parent commit SHA | Optional
| `dry_run` | Don't upload files to Codecov | Optional | `directory` | Directory to search for coverage reports. | Optional
| `env_vars` | Environment variables to tag the upload with. Multiple env variables can be separated with commas (e.g. `OS,PYTHON`) | Optional | `disable_search` | Disable search for coverage files. This is helpful when specifying what files you want to upload with the --file option. | Optional
| `fail_ci_if_error` | Specify if CI pipeline should fail when Codecov runs into errors during upload. *Defaults to **false*** | Optional | `disable_file_fixes` | Disable file fixes to ignore common lines from coverage (e.g. blank lines or empty brackets) | Optional
| `files` | Comma-separated paths to the coverage report(s). Negated paths are supported by starting with `!` | Optional | `dry_run` | Don't upload files to Codecov | Optional
| `flags` | Flag the upload to group coverage metrics (unittests, uitests, etc.). Multiple flags are separated by a comma (ui,chrome) | Optional | `env_vars` | Environment variables to tag the upload with (e.g. PYTHON | OS,PYTHON) | Optional
| `full_report` | Specify the path of a full Codecov report to re-upload | Optional | `exclude` | Folders to exclude from search | Optional
| `functionalities` | Toggle functionalities | Optional | `fail_ci_if_error` | Specify whether or not CI build should fail if Codecov runs into an error during upload | Optional
| -- `network` | Disable uploading the file network | Optional | `file` | Path to coverage file to upload | Optional
| -- `fixes` | Enable file fixes to ignore common lines from coverage | Optional | `files` | Comma-separated list of files to upload | Optional
| -- `search` | Disable searching for coverage files | Optional | `flags` | Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome) | Optional
| `gcov` | Run with gcov support | Optional | `handle_no_reports_found` | Raise no exceptions when no coverage reports found | Optional
| `gcov_args` | Extra arguments to pass to gcov | Optional | `job_code` | The job code | Optional
| `gcov_ignore` | Paths to ignore during gcov gathering | Optional | `name` | User defined upload name. Visible in Codecov UI | Optional
| `gcov_include` | Paths to include during gcov gathering | Optional | `os` | Override the assumed OS. Options are linux | macos | windows | . | Optional
| `gcov_executable` | gcov executable to run. Defaults to gcov. | Optional | `override_branch` | Specify the branch name | Optional
| `name` | Custom defined name for the upload | Optional | `override_build` | Specify the build number | Optional
| `network_filter` | Specify a filter on the files listed in the network section of the Codecov report. Useful for upload-specific path fixing | Optional | `override_build_url` | The URL of the build where this is running | Optional
| `network_prefix` | Specify a prefix on files listed in the network section of the Codecov report. Useful to help resolve path fixing | Optional | `override_commit` | Specify the commit SHA | Optional
| `os` | Specify the OS (linux, macos, windows, alpine) | Optional | `override_pr` | Specify the pull request number | Optional
| `override_branch` | Specify the branch name | Optional | `plugin` | plugins to run. Options: xcode, gcov, pycoverage. The default behavior runs them all. | Optional
| `override_build` | Specify the build number | Optional | `plugins` | Comma-separated list of plugins for use during upload. | Optional
| `override_commit` | Specify the commit SHA | Optional | `report_code` | The code of the report. If unsure, do not include | Optional
| `override_pr` | Specify the pull request number | Optional | `root_dir` | Used when not in git/hg project to identify project root directory | Optional
| `override_tag` | Specify the git tag | Optional | `slug` | Specify the slug manually (Enterprise use) | Optional
| `root_dir` | Used when not in git/hg project to identify project root directory | Optional | `url` | Specify the base url to upload (Enterprise use) | Optional
| `directory` | Directory to search for coverage reports. | Optional | `use_legacy_upload_endpoint` | Use the legacy upload endpoint | Optional
| `slug` | Specify the slug manually (Enterprise use) | Optional | `verbose` | Specify whether the Codecov output should be verbose | Optional
| `swift` | Run with swift coverage support | Optional | `version` | Specify which version of the Codecov CLI should be used. Defaults to `latest` | Optional
| -- `swift_project` | Specify the swift project to speed up coverage conversion | Optional | `working-directory` | Directory in which to execute codecov.sh | Optional
| `upstream_proxy` | The upstream http proxy server to connect through | Optional
| `url` | Change the upload host (Enterprise use) | Optional
| `verbose` | Specify whether the Codecov output should be verbose | Optional
| `version` | Specify which version of the Codecov Uploader should be used. Defaults to `latest` | Optional
| `working-directory` | Directory in which to execute `codecov.sh` | Optional
| `xtra_args` | Add additional uploader args that may be missing in the Action | Optional
### Example `workflow.yml` with Codecov Action ### Example `workflow.yml` with Codecov Action