diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index baba82853..73f195af6 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -60,3 +60,6 @@ jobs: # Main step - name: Unit tests run: bundle exec fastlane test + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 diff --git a/README.md b/README.md index 704f07064..b0b80ff36 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [![Swift 5.x](https://img.shields.io/badge/Swift-5.x-orange)](https://developer.apple.com/swift) [![Build status](https://badge.buildkite.com/cc8f93e32da93fa7c1172398bd8af66254490567c7195a5f3f.svg?branch=develop)](https://buildkite.com/matrix-dot-org/element-ios/builds?branch=develop) [![Weblate](https://translate.riot.im/widgets/riot-ios/-/svg-badge.svg)](https://translate.riot.im/engage/riot-ios/?utm_source=widget) +[![codecov](https://codecov.io/gh/vector-im/element-ios/branch/develop/graph/badge.svg?token=INNm5o6XWg)](https://codecov.io/gh/vector-im/element-ios) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=im.vector.app.ios&metric=alert_status)](https://sonarcloud.io/dashboard?id=im.vector.app.ios) [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=im.vector.app.ios&metric=bugs)](https://sonarcloud.io/dashboard?id=im.vector.app.ios) [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=im.vector.app.ios&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=im.vector.app.ios) diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..33f6aec9f --- /dev/null +++ b/codecov.yml @@ -0,0 +1,16 @@ +coverage: + status: + project: + default: + # Commits pushed to master should not make the overall + # project coverage decrease by more than 1%: + target: auto + threshold: 1% + patch: + default: + # Be tolerant on slight code coverage diff on PRs to limit + # noisy red coverage status on github PRs. + # Note: The coverage stats are still uploaded + # to codecov so that PR reviewers can see uncovered lines + target: auto + threshold: 1%