Codacy coverage support for C#. This tool uses Codacy API to send the coverage report parsed from OpenCover or dotCover coverage tools.
- Do
dotnet restore
; - And then
dotnet build
.
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.
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
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
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
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
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
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.
Apache License Version 2.0, January 2004
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.
- 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.
Codacy is free for Open Source projects.