Cake addin that extends Cake with the ability to use the official Codecov CLI.
Get Started
| Product | Versions |
|---|---|
| .NET |
README
Cake.Codecov
A Cake addin that extends Cake with the ability to use the official Codecov CLI that have been repackaged as a NuGet package named CodecovUploader.
Table of Contents
Usage
In order to use this addin, add to your Cake script
#tool nuget:?package=CodecovUploader
#addin nuget:?package=Cake.Codecov // Any versions before 1.1.0 is not guaranteed to work anymore.
Then use one of the following snippets to upload your coverage report to Codecov.
Task("Upload-Coverage")
.Does(() =>
{
// Upload a coverage report.
Codecov("coverage.xml");
});
Task("Upload-Coverage")
.Does(() =>
{
// Upload coverage reports.
Codecov(new[] { "coverage1.xml", "coverage2.xml" });
});
Task("Upload-Coverage")
.Does(() =>
{
// Upload a coverage report by providing the Codecov upload token.
Codecov("coverage.xml", "00000000-0000-0000-0000-000000000000");
});
Task("Upload-Coverage")
.Does(() =>
{
// Upload coverage reports by providing the Codecov upload token.
Codecov(new[] { "coverage1.xml", "coverage2.xml" }, "00000000-0000-0000-0000-000000000000");
});
Task("Upload-Coverage")
.Does(() =>
{
// Upload a coverage report using the CodecovSettings.
Codecov(new CodecovSettings {
Files = new[] { "coverage.xml" },
Token = "00000000-0000-0000-0000-000000000000",
Flags = "ut"
});
});
Documentation
Documentation for the addin can be found on the Cake Website.
Codecov Tips
- While CI Service like GitHub Action, these workflows are likely to hit a rate limit on Codecov. As such it is recommended to always pass in a repository or global token when one is available.
- Do not set NonZero to
truewhen running without a Codecov token.
Questions
Feel free to open an issue or ask a question in GitHub Discussions under the Extension Q&A category, and by tagging us: @larzw and/or @AdmiringWorm.
Known Issues
Coverage report upload fails when using gitversion (or other tools that change the appveyor build version) Workaround: Add the following in your Upload Coverage task (only needed if gitversion is run on the same call as the uploading of coverage reports in appveyor.yml)
Task("Upload-Coverage") .Does(() => { // The logic may differ from what you actually need. // This way is for the use with GitVersion. // Basically, the buildVersion format needs to be exactly the // same as the build version shown on appveyor when the build is done. var buildVersion = string.Format("{0}.build.{1}", variableThatStores_GitVersion_FullSemVer, BuildSystem.AppVeyor.Environment.Build.Number ); var settings = new CodecovSettings { Files = new[] { "coverage.xml" }, EnvironmentVariables = new Dictionary<string,string> { { "APPVEYOR_BUILD_VERSION", buildVersion } } }; Codecov(settings); });
Contributors
Thanks goes to these wonderful people (emoji key):
Larz White
π§
Kim J. Nordmo
π§
Gary Ewan Park
π π€
Vishal Bishnoi
π»
Pascal Berger
π€
Toni Wenzel
π€
jericho
π€
Sean Fausett
π»
C. Augusto Proiete
π π€
Nils Andresen
π»
This project follows the all-contributors specification. Contributions of any kind welcome!
Downloads by Version
Similar & Alternative Packages
Hand-picked matching NuGet libraries based on tags & ecosystem
Depended On By
Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.