-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from codecov/update-readme
fix: update REAMDE
- Loading branch information
Showing
1 changed file
with
6 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,18 @@ | ||
# [Codecov](https://codecov.io) PHP Example | ||
[![codecov](https://codecov.io/github/codecov/example-php/branch/main/graph/badge.svg?token=A7Mb0qlkNW)](https://app.codecov.io/github/codecov/example-php) | ||
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fexample-php.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fexample-php?ref=badge_shield) | ||
|
||
This example repository shows how Codecov can be integrated with a simple php project. It uses **GitHub Actions** as the CI/CD provider and **phpunit** as the coverage provider. | ||
|
||
## Guide | ||
|
||
### Travis Setup | ||
|
||
Add to your `.travis.yml` file. | ||
```yml | ||
language: php | ||
|
||
script: | ||
- vendor/bin/phpunit --coverage-clover coverage.xml | ||
|
||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) | ||
``` | ||
### Produce Coverage Reports | ||
Collect coverage reports `vendor/bin/phpunit --coverage-clover coverage.xml`, [see here](https://github.com/codecov/example-php/blob/master/.travis.yml#L15) | ||
|
||
### FAQ | ||
- Q: Can I use phpunit.xml.dist?<br/>A: Start tracking coverage metrics by adding a coverage logger: | ||
```xml | ||
<phpunit> | ||
... | ||
<logging> | ||
<log type="coverage-clover" target="clover.xml"/> | ||
</logging> | ||
</phpunit> | ||
``` | ||
- Q: I don't see one or more files, why?<br/>A: Codecov will only show files that have lines covered (hit or miss). If your file has no statments it will not show up in Codecov until you add some. Go get em' tiger! | ||
|
||
## Caveats | ||
### Private Repo | ||
Repository tokens are required for (a) all private repos, (b) public repos not using Travis-CI, CircleCI or AppVeyor. Find your repository token at Codecov and provide via appending `-t <your upload token>` to you where you upload reports. | ||
For more information, please see the links below. | ||
|
||
## Links | ||
- [Quick Start](https://docs.codecov.com/docs/quick-start) | ||
- [GitHub Tutorial](https://docs.codecov.com/docs/github-tutorial) | ||
- [Community Boards](https://community.codecov.io) | ||
- [Support](https://codecov.io/support) | ||
- [Documentation](https://docs.codecov.io) | ||
|
||
|
||
## License | ||
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fexample-php.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fexample-php?ref=badge_large) | ||
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fexample-php.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fexample-php?ref=badge_large) |