Skip to content

Commit ced5e62

Browse files
committed
Add codecov
1 parent 76aba35 commit ced5e62

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

.github/workflows/codecov.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Workflow for Codecov
2+
on: [push, pull_request]
3+
jobs:
4+
run:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Checkout
8+
uses: actions/checkout@v4
9+
with:
10+
submodules: 'true'
11+
- name: Set up JDK 11
12+
uses: actions/setup-java@v3
13+
with:
14+
distribution: 'temurin'
15+
java-version: 11
16+
- name: Install dependencies, run tests, and collect coverage
17+
run: ./gradlew jacocoTestReport
18+
- name: Upload coverage to Codecov
19+
uses: codecov/codecov-action@v4
20+
env:
21+
CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}
22+
slug: uber/cadence

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ jacoco {
355355
}
356356

357357
jacocoTestReport {
358+
dependsOn test
358359
reports {
359360
xml.enabled = true // coveralls plugin depends on xml format report
360361
html.enabled = true

codecov.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Refs:
2+
# - https://docs.codecov.com/docs/common-recipe-list
3+
# - https://docs.codecov.com/docs/codecovyml-reference
4+
#
5+
# After making changes, run below command to validate
6+
# curl --data-binary @codecov.yml https://codecov.io/validate
7+
coverage:
8+
range: 80...100
9+
round: down
10+
precision: 2
11+
status:
12+
project: # measuring the overall project coverage
13+
default: # context, you can create multiple ones with custom titles
14+
informational: true
15+
target: 85% # specify the target coverage for each commit status
16+
# option: "auto" (compare against parent commit or pull request base)
17+
# option: "X%" a static target percentage to hit
18+
threshold: 0% # allow the coverage drop by x% before marking as failure
19+
if_ci_failed: ignore # require the CI to pass before setting the status
20+
patch:
21+
default:
22+
target: 85% # specify the target coverage for each commit status
23+
# option: "auto" (compare against parent commit or pull request base)
24+
# option: "X%" a static target percentage to hit
25+
threshold: 0% # allow the coverage drop by x% before marking as failure
26+
comment:
27+
layout: "header, files, footer"
28+
hide_project_coverage: false
29+
codecov:
30+
require_ci_to_pass: false

0 commit comments

Comments
 (0)