Skip to content

Commit

Permalink
Add codecov (#920)
Browse files Browse the repository at this point in the history
  • Loading branch information
natemort authored Oct 14, 2024
1 parent 76aba35 commit c6891e2
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Workflow for Codecov
on: [push, pull_request]
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install dependencies, run tests, and collect coverage
run: docker compose -f docker/buildkite/docker-compose.yaml run unit-test-test-service
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}
slug: uber/cadence
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ task registerDomain(type:JavaExec) {
test {
dependsOn 'registerDomain'
dependsOn 'licenseMain'
finalizedBy jacocoTestReport // report is always generated after tests run
testLogging {
events 'passed', 'skipped', 'failed'
exceptionFormat 'full'
Expand Down Expand Up @@ -355,6 +356,7 @@ jacoco {
}

jacocoTestReport {
dependsOn test
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
Expand Down
30 changes: 30 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Refs:
# - https://docs.codecov.com/docs/common-recipe-list
# - https://docs.codecov.com/docs/codecovyml-reference
#
# After making changes, run below command to validate
# curl --data-binary @codecov.yml https://codecov.io/validate
coverage:
range: 80...100
round: down
precision: 2
status:
project: # measuring the overall project coverage
default: # context, you can create multiple ones with custom titles
informational: true
target: 85% # specify the target coverage for each commit status
# option: "auto" (compare against parent commit or pull request base)
# option: "X%" a static target percentage to hit
threshold: 0% # allow the coverage drop by x% before marking as failure
if_ci_failed: ignore # require the CI to pass before setting the status
patch:
default:
target: 85% # specify the target coverage for each commit status
# option: "auto" (compare against parent commit or pull request base)
# option: "X%" a static target percentage to hit
threshold: 0% # allow the coverage drop by x% before marking as failure
comment:
layout: "header, files, footer"
hide_project_coverage: false
codecov:
require_ci_to_pass: false

0 comments on commit c6891e2

Please sign in to comment.