Find and copy a Project API Token. You can find the token within a repository Settings → Integrations → Project API.
You should keep your API token well protected, as it grants owner permissions to your projects.
Set the Project API Token in your terminal, replacing
%Project_Token%with your token:
To upload coverage to a self-hosted installation of Codacy you also need to set your installation URL, replacing
%Codacy_instance_URL%with your URL:
If you'd like to automate this process for multiple repositories you can authenticate using an Account API Token.
Running Codacy Coverage Reporter¶
The easiest way to get starting is by using the self-contained script that downloads and runs the reporter:
bash <(curl -Ls https://coverage.codacy.com/get.sh)
Choose a specific version¶
The script uses by default the latest version.
If you want to specify a coverage reporter version, use
CODACY_REPORTER_VERSION environment variable.
You can find all versions in the Releases tab.
Using CircleCI? Check out the codacy/coverage-reporter orb.
Using GitHub Actions? Check out the codacy/coverage-coverage-reporter action.
If the automated script does not cover your use case, check the manual installation methods.
The following table contains the formats supported and which coverage tools generate them:
|Language||Coverage tools (examples)||Formats||Filename|
Mocha + Blanket.js
|LCOV||lcov.info, lcov.dat, *.lcov|
|PHP||PHPUnit||PHPUnit XML (version <= 4)
lcov.info, lcov.dat, *.lcov
|Swift/Objective-C||XCode Coverage||Check here information about reports for this language|
The reporter assumes the coverage reports filename follow the name convention. Otherwise, you must define the report's location with the flag
If your coverage reports are in a different format you can use a format converter, such as ReportGenerator, to generate a supported format.
If your language is not in the list of supported languages, you can still send coverage to Codacy. You can do it by providing the correct
--language name and then add the
Commit SHA hash detection¶
Codacy automatically detects a commit SHA hash from CI workflows, the git repository or command line arguments. See all supported environments.
Multiple coverage reports for the same language¶
You can upload multiple reports if your test suite is split in different modules or ran in parallel. See how to upload multiple coverage reports.
For a complete list of commands and options: