Coder Social home page Coder Social logo

csharp-codacy-coverage's Introduction

Deprecated

This repository is no longer maintained. As an alternative, check codacy-coverage-reporter to send your test coverage results to your Codacy dashboard.

Codacy C# Coverage Reporter

Codacy Badge Circle CI

Codacy coverage support for C#. This tool uses Codacy API to send the coverage report parsed from OpenCover or dotCover coverage tools.

Build

  1. Do dotnet restore ;
  2. And then dotnet build .

Usage

This is the parameters list:

  • -c, --commit: Specify the commit UUID (Required)
  • -t, --token: Specify the project token (Required)
  • -r, --report: Path to the coverage report (Required)
  • -e, --engine: Engine Report Type (dotcover, opencover). (Required)
  • -p, --partial: Send report as a partial report (Default: false)
  • -f, --final: Send final coverage request (Default: false)
  • --help: Display this help screen.
  • --version: Display version information.

Detecting commit UUID

On CI from Environment Variables:

  • CI_COMMIT
  • TRAVIS_PULL_REQUEST_SHA
  • TRAVIS_COMMIT
  • DRONE_COMMIT
  • CIRCLE_SHA1
  • CI_COMMIT_ID
  • WERCKER_GIT_COMMIT
  • CODEBUILD_RESOLVED_SOURCE_VERSION
  • SCRUTINIZER_SHA1
  • REVISION

Codacy endpoint

On CI, from Environment Variables, CODACY_API_BASE_URL can be used to define the endpoint (e.g. http://codacy.mydomain.com:16006). By default, Codacy Cloud endpoint is used.

Windows w/ compressed archive

Invoke-WebRequest -Uri https://github.com/codacy/csharp-codacy-coverage/releases/download/$env:CODACY_COVERAGE_VERSION/csharp-codacy-coverage_win-x64.zip -OutFile csharp-codacy-coverage_win-x64.zip
Expand-Archive csharp-codacy-coverage_win-x64.zip -DestinationPath C:\temp\Codacy.CSharpCoverage\

C:\temp\Codacy.CSharpCoverage\Codacy.CSharpCoverage.exe -c $env:REPO_COMMIT_UUID -t $env:CODACY_PROJECT_TOKEN -r coverage.xml -e opencover

Windows w/ self-contained binary

Invoke-WebRequest -Uri https://github.com/codacy/csharp-codacy-coverage/releases/download/$env:CODACY_COVERAGE_VERSION/Codacy.CSharpCoverage_win-x64.exe -OutFile C:\temp\Codacy.CSharpCoverage_win-x64.exe

C:\temp\Codacy.CSharpCoverage_win-x64.exe -c $env:REPO_COMMIT_UUID -t $env:CODACY_PROJECT_TOKEN -r MyProject_coverage.xml -e opencover

Linux or macOS w/ compressed archive

curl -Ls https://github.com/codacy/csharp-codacy-coverage/releases/download/$CODACY_COVERAGE_VERSION/csharp-codacy-coverage_<linux|osx>-x64.tar.gz --output csharp-codacy-coverage_<linux|osx>-x64.tar.gz
tar xvzf csharp-codacy-coverage_<linux|osx>-x64.tar.gz -C /tmp/Codacy.CSharpCoverage/
/tmp/Codacy.CSharpCoverage/Codacy.CSharpCoverage.CSharpCoverage -c $REPO_COMMIT_UUID -t $CODACY_PROJECT_TOKEN -r MyProject_coverage.xml -e opencover

Linux or macOS w/ self-contained binary

curl -Ls https://github.com/codacy/csharp-codacy-coverage/releases/download/$CODACY_COVERAGE_VERSION/Codacy.CSharpCoverage_<linux|osx>-x64 --output Codacy.CSharpCoverage_<linux|osx>-x64
chmod +x ./Codacy.CSharpCoverage_<linux|osx>-x64
./Codacy.CSharpCoverage_<linux|osx>-x64 -c $REPO_COMMIT_UUID -t $CODACY_PROJECT_TOKEN -r MyProject_coverage.xml -e opencover

FAQ

What's the difference between the compressed archive and self-contained binary

The compressed archive is compiled using netcoreapp2.2 framework and has all .dll dependencies inside the archive. The self-contained binary is built under the netcoreapp3.0 framework which compiles to a single binary containing all dependencies bundled insides. That could be useful for portability.

License

Apache License Version 2.0, January 2004

What is Codacy

Codacy is an Automated Code Review Tool that monitors your technical debt, helps you improve your code quality, teaches best practices to your developers, and helps you save time in Code Reviews.

Among Codacy’s features

  • Identify new Static Analysis issues
  • Commit and Pull Request Analysis with GitHub, BitBucket/Stash, GitLab (and also direct git repositories)
  • Auto-comments on Commits and Pull Requests
  • Integrations with Slack, HipChat, Jira, YouTrack
  • Track issues in Code Style, Security, Error Proneness, Performance, Unused Code and other categories

Codacy also helps keep track of Code Coverage, Code Duplication, and Code Complexity.

Codacy supports PHP, Python, Ruby, Java, JavaScript, and Scala, among others.

Free for Open Source

Codacy is free for Open Source projects.

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.