/codecov-exe

.exe report uploader for Codecov https://codecov.io

Primary LanguageC#MIT LicenseMIT

Codecov global executable uploader for PowerShell and Windows Command Line.

https://codecov.io/ @codecov hello@codecov.io

Introduction

AppVeyor branch NuGet Chocolatey Gitter codecov

  1. This uploader supports Windows Command Line and PowerShell on Windows 7 (x64) and above. If you need support for OS X or Linux use the bash global uploader. However, since this is a .NET Core app, builds for OS X and Linux will eventually come.

  2. The following Services are supported: AppVeyor, TeamCity (see section on TeamCity), and Git.

  3. Many Codecov CLI options are supported. Run .\codecov.exe --help or see CommandLineOptions.cs for more details.

  4. You can download the exe from NuGet or Chocolatey. As an alternative to NuGet or Chocolatey you can download the exe as the asset Codecov.zip under the release. The following PowerShell (version 5) commands might be helpful

(New-Object System.Net.WebClient).DownloadFile("<url>", (Join-Path $pwd "Codecov.zip")) # Download Codecov.zip from github release.
Expand-Archive .\Codecov.zip -DestinationPath . # UnZip the file.
.\Codecov\codecov.exe # Run codecov.exe with whatever commands you need.

Quick Start

For a basic use case, in PowerShell run the following commands,

> choco install codecov
> .\codecov.exe -f <path to coverage report> -t <Codecov upload token>

For an AppVeyor build, the appveyor.yml file would look something like

before_build:
- choco install codecov
test_script:
# Note that, a Codecov upload token is not required.
- codecov -f <path to coverage report>

Cake Addin

If you use Cake (C# Make) for your builds, you may be intrested in the Cake.Codecov addin.

TeamCity

TeamCity does not automatically make build parameters available as environment variables. You will need to add the following environment parameters to the build configuration. To do this make sure your Branch specification under the VCS Root is configured correctly,

Then set your environment variables,

Note that, the above environment variables (except for env.TEAMCITY_BUILD_URL) can alternatively be set via the command line,

env.TEAMCITY_BUILD_BRANCH => --branch
env.TEAMCITY_BUILD_ID => --build
env.TEAMCITY_BUILD_COMMIT => --sha
env.TEAMCITY_BUILD_REPOSITORY => --slug

Questions and Contributions

All types of contributions are welcome! Feel free to open an issue or @larzw me via Gitter

Maintainers

To create a release (to be automated)

  • Update chocolatey nuspec version.
  • Update nuget nuspec version.
  • Update Codecov.csproj version.
  • In PowerShell run .\build.ps1.
  • Update the checksum in VERIFICATION.txt.
  • Run .\build.ps1 AGAIN.
  • Push changes to Github, tag the release, and add ./nuspec/chocolatey/tools/Codecov.zip as an asset.
  • Upload the artifacts to Nuget.org and/or chocolatey.org.