Code Monkey home page Code Monkey logo

cake.codecov's Introduction

Cake.Codecov

All Contributors AppVeyor branch GitHub Build NuGet 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

  1. 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.
  2. Do not set NonZero to true when 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
Larz White

๐Ÿšง
Kim J. Nordmo
Kim J. Nordmo

๐Ÿšง
Gary Ewan Park
Gary Ewan Park

๐Ÿ‘€ ๐Ÿค”
Vishal Bishnoi
Vishal Bishnoi

๐Ÿ’ป
Pascal Berger
Pascal Berger

๐Ÿค”
Toni Wenzel
Toni Wenzel

๐Ÿค”
jericho
jericho

๐Ÿค”
Sean Fausett
Sean Fausett

๐Ÿ’ป
C. Augusto Proiete
C. Augusto Proiete

๐Ÿ“– ๐Ÿค”
Nils Andresen
Nils Andresen

๐Ÿ’ป

This project follows the all-contributors specification. Contributions of any kind welcome!

cake.codecov's People

Contributors

admiringworm avatar allcontributors[bot] avatar augustoproiete avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar gitfool avatar larzw avatar mergify[bot] avatar nils-a avatar vkbishnoi avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cake.codecov's Issues

Update Cake.Recipe to latest 3.x version

We should update the version of Cake.Recipe being used to the latest available version of Cake.Recipe. This will allow us to make use of some of the features introduced in a later version there.

Add wyam documentation

Similar to other cake addins, we should generate some basic documentation using wyam.

Recommended changes resulting from automated audit

We performed an automated audit of your Cake addin and found that it does not follow all the best practices.

We encourage you to make the following modifications:

  • You are currently referencing Cake.Core 0.26.1. Please upgrade to 0.28.0
  • The Cake.Core reference should be private. Specifically, your addin's .csproj should have a line similar to this: <PackageReference Include="Cake.Core" Version="0.28.0" PrivateAssets="All" />
  • The nuget package for your addin should use the cake-contrib icon. Specifically, your addin's .csproj should have a line like this: <PackageIconUrl>https://cdn.rawgit.com/cake-contrib/graphics/a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png</PackageIconUrl>.

Apologies if this is already being worked on, or if there are existing open issues, this issue was created based on what is currently published for this package on NuGet.org and in the project on github.

Add cake-addin tag to Cake.Codecov NuGet package

The NuGet Gallery will soon include a "Cake" tab with instructions on how to use NuGet packages in Cake build scripts. I'd like to suggest that you include the tag cake-addin in the NuGet package of this addin, so that the NuGet Gallery can display the correct instructions to install this addin.

The UI will look similar to this:

image

Documentation on best practices on tags for Cake addins: https://cakebuild.net/docs/extending/addins/best-practices#tags

The assembly 'Cake.Codecov, Version=1.0.0.0 is referencing an older version of Cake.Core (0.22.0)

Hi Team

I am using the Wyam Cake Recipe but am experiencing the following error:

Error: The assembly 'Cake.Codecov, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (0.22.0).
This assembly need to reference at least Cake.Core version 0.26.0.
Another option is to downgrade Cake to an earlier version.
It's not recommended, but you can explicitly opt-out of assembly verification
by configuring the Skip Verification setting to true
(i.e. command line parameter "--settings_skipverification=true",
environment variable "CAKE_SETTINGS_SKIPVERIFICATION=true",
read more about configuration at https://cakebuild.net/docs/fundamentals/configuration)

Do you think you could point me in the direction of how to fix this?

Add travis ci build

Not really a priority, as codecov-exe does not yet support travis.

But would be nice to at least have it enabled

Failed to upload the report

My Cake addin build keeps failing (as you can see here, here and here) with the following error:

              _____          _
             / ____|        | |
            | |     ___   __| | ___  ___ _____   __
            | |    / _ \ / _  |/ _ \/ __/ _ \ \ / /
            | |___| (_) | (_| |  __/ (_| (_) \ V /
             \_____\___/ \____|\___|\___\___/ \_/
                                         exe-1.0.3
            
2018-03-08 21:29:08 [Information] AppVeyor detected.
2018-03-08 21:29:08 [Information] Git detected.
2018-03-08 21:29:08 [Information] Project root: C:\projects\cake-email-common
2018-03-08 21:29:08 [Information] Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml
2018-03-08 21:29:08 [Information] Reading reports.
2018-03-08 21:29:08 [Information] BuildArtifacts/TestCoverage/OpenCover.xml
2018-03-08 21:29:08 [Information] Uploading Reports.
2018-03-08 21:29:09 [Information] url: https://codecov.io
2018-03-08 21:29:10 [Information] query: https://codecov.io/upload/v4?branch=master&commit=c5b45acda9c64af385308d38a3501d1898bbab14&build=uhf6jhk5uh637e97&tag=&pr=&name=&flags=&slug=cake-contrib%2FCake.Email.Common&token=&package=exe-1.0.3&build_url=&yaml=&job=cakecontrib%2Fcake-email-common%2F0.2.0%2B0.build.11&service=appveyor
2018-03-08 21:29:10 [Information] Pinging Codecov
2018-03-08 21:29:18 [Fatal] Failed to upload the report.
   at Codecov.Upload.Uploads.Uploader() in C:\Users\larz\github\codecov-exe\Source\Codecov\Upload\Uploads.cs:line 34
   at Codecov.Program.UploadFacade.Uploader() in C:\Users\larz\github\codecov-exe\Source\Codecov\Program\UploadFacade.cs:line 119
   at Codecov.Program.Run.Runner(IEnumerable`1 args) in C:\Users\larz\github\codecov-exe\Source\Codecov\Program\Run.cs:line 20
Cake.exe : An error occurred when executing task 'Upload-Codecov-Report'.
At C:\projects\cake-email-common\build.ps1:235 char:1
+ &$CAKE_EXE $cakeArguments
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (An error occurr...odecov-Report'.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
Codecov: Process returned an error (exit code 1).

Any help investigating this issue would be appreciated.

Recommended changes resulting from automated audit

We performed an automated audit of your Cake addin and found that it does not follow all the best practices.

We encourage you to make the following modifications:

  • You are currently referencing Cake.Core 0.28.0. Please upgrade to 0.33.0
  • The nuget package for your addin should use the cake-contrib icon. Specifically, your addin's .csproj should have a line like this: <PackageIconUrl>https://cdn.jsdelivr.net/gh/cake-contrib/graphics/png/cake-contrib-medium.png</PackageIconUrl>.

Apologies if this is already being worked on, or if there are existing open issues, this issue was created based on what is currently published for this package on NuGet.

This issue was created by a tool: Cake.AddinDiscoverer version 3.12.1

Update codecov addin runner to support official codecov binary

The codecov team have deprecated the use of all community maintained applications, the community maintained applications will stop working in Januarry/February, as such this addin needs to be updated to ensure it is compatible with the official binary.

It is uncertain at this time if it will be a breaking change or not.

Update build environments to the latest version

image

Identified so far:

  • Build (windows-2019) - windows-2019 is missing .NET 5.0
  • Build (macos-10.15) - macos-10.15 does no longer exist
  • Build (ubuntu-20.04) - ubuntu-20.04 does no longer exist

Your .dependabot/config.yml contained invalid details

Dependabot encountered the following error when parsing your .dependabot/config.yml:

The property '#/update_configs/0/ignored_updates/0' contains additional properties ["dependency_name"] outside of the schema when none are allowed
The property '#/update_configs/0/ignored_updates/0/match' of type null did not match the following type: object

Please update the config file to conform with Dependabot's specification.

You can mention @dependabot in the comments below to contact the Dependabot team.

Changed AppVeyor Build Number not detected.

Just changed one of my projects to use Cake.Codecov and which changes the build version of AppVeyor (using GitVersion) and this change was not detected when trying to upload the coverage report.

The codecov tool still detected the old build version, and since I believe this is pretty much related to being run from Cake we should consider perhaps adding some detection logic in the Cake.Codecov addin to grab the build number. Perhaps by reading the environment variable set by gitversion (GitVersion_SemVer) and if it exists, use the output from the mentioned environment variable, append .build and appending the APPVEYOR_BUILD_NUMBER. (Or more simplified, using the APPVEYOR_BUILD_VERSION).

I'm still testing it what's best on my own project, to see the best aproach, but opening this for tracking.

Add support for .NET 7.0

When we bump the cake.Core dependency to 3.2.0 we should also add support for .NET 7.0, as that is what the latest version of Cake 3.x supports.

Would it be possible to use the Cake Contrib Icon for your NuGet Package?

Thanks again for creating this Cake Addin, we really appreciate the effort that you have put in to creating it.

We, the Cake Team, recently announced a new Cake Contrib Icon, details of which can be found here:

http://cakebuild.net/blog/2017/06/new-cake-contrib-icon

Would you consider changing the nuspec file for your NuGet Package to use this new Cake Contrib Icon? If so, the recommended URL to use is:

https://cdn.rawgit.com/cake-contrib/graphics/a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png

Details of the above URL can be found in the repository here:

https://github.com/cake-contrib/graphics

Please let me know if you have any questions.

Your .dependabot/config.yml contained invalid details

Dependabot encountered the following error when parsing your .dependabot/config.yml:

The property '#/update_configs/0/ignored_updates/0' contains additional properties ["dependency_name"] outside of the schema when none are allowed
The property '#/update_configs/0/ignored_updates/0/match' of type null did not match the following type: object

Please update the config file to conform with Dependabot's specification.

You can mention @dependabot in the comments below to contact the Dependabot team.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.