Movatterモバイル変換


[0]ホーム

URL:


Installation

Using Pip

To use codecov-cli in your local machine, or your CI workflows, you need to install it:

pip install codecov-cli

The above command will download the latest version of Codecov-cli. If you wish to use a specific version, releases can be viewedhere.

Your default will need to be Python3 in order to make this work.

Note, the Codecov CLI expects to be run in the checked out repos, on a machine with git installed.

Note: If you're installing in a pytest environment, you may need to callpytest rehash before the CLI will work.

As a Binary

If you would like to use the CLI in an environment that does not have access to Python / PIP, you can install the CLI as a compiled binary. Linux and macOS releases can be foundhere, along with SHASUMs and signatures for each released version. Binary releases are also available viaGithub releases on this repository. Note, the Codecov CLI expects to be run in the checked out repos, on a machine with git installed.

You can retrieve the Binary for Linux directly from your command line as follows:

curl -Os https://cli.codecov.io/latest/linux/codecovsudo chmod +x codecov./codecov --help

Integrity Checking the Binary

The binary can be integrity checked using a SHASUM256 and SHASUM256.sig file. The process for macos and Linux is identical. Linux is as follows:

curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step  curl -Os https://cli.codecov.io/latest/linux/codecovcurl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUMcurl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM.siggpgv codecov.SHA256SUM.sig codecov.SHA256SUMshasum -a 256 -c codecov.SHA256SUM

For macos you will want to use the macos distributions of the binary (e.g.,<https://cli.codecov.io/latest/macos/codecov>)

📘

--help

If the installation is successful, runningcodecovcli --help will output the available commands along with the different general options that can be used with them

Usage

Usage: codecov-cli [OPTIONS] COMMAND [ARGS]...

Codecov-cli supports user input. These inputs, along with their descriptions and usage contexts, are listed in the table below:

InputDescriptionUsage
--auto-load-params-fromThe CI/CD PlatformOptional
--codecov-yml-pathThe path for your codecov.ymlOptional
--enterprise-urlChange the upload host (enterprise use)Optional
--versionCodecov-cli's versionOptional
--verbose or-vRun the cli with verbose loggingOptional

How to Upload to Codecov

If desired, the CLI can be used as a replacement for ourNodeJS Binary Uploader. To use the CLI to upload from your CI workflow, you need to add these commands:

curl -Os https://cli.codecov.io/latest/linux/codecovsudo chmod +x codecov./codecov --verbose upload-process --disable-search -t ${{ secrets.CODECOV_TOKEN }} -n 'job-name'-${{ github.run_id }} -F <flag name> -f <covarage report file name>

Alternatively, you can setup the CLI via thepip install command

pip install codecov-clicodecovcli --verbose upload-process --disable-search  -t ${{ secrets.CODECOV_TOKEN }} -n 'job-name'-${{ github.run_id }} -F <flag name> -f <covarage report file name>

The Codecov CLI will needa Codecov upload token to authenticate its requests to Codecov. You can set the token in an environment variable called$CODECOV_TOKEN or pass it as a command line argument like so:-t ${{ secrets.CODECOV_TOKEN }}.

Refresher on defining environmental variables:For GitHub,For Bitbucket,For Gitlab.

You can customize each of these commands with additional options that are detailed on ourCLI options doc.

📘

Switching to the CLI from a different upload method?

You will need to take out your old uploader step and replace it with the above commands to upload to Codecov using the CLI.

Updated 3 months ago



[8]ページ先頭

©2009-2025 Movatter.jp