Skip to content

Commit 17644f9

Browse files
authored
Add upload coverage results to codecov (#44)
1 parent ccecd2c commit 17644f9

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

.github/workflows/check.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on:
1111
type: string
1212
required: true
1313
description: "task to check the platform targets"
14+
upload-code-coverage:
15+
type: boolean
16+
description: "enabled uploading coverage report to codecov"
17+
required: false
18+
default: false
1419

1520
jobs:
1621
check:
@@ -46,4 +51,10 @@ jobs:
4651
${{ inputs.task }}
4752
detektAll
4853
ktlintCheck
49-
apiCheck
54+
apiCheck
55+
koverXmlReport
56+
- name: Upload coverage reports to Codecov
57+
if: inputs.upload-code-coverage
58+
uses: codecov/codecov-action@v3
59+
env:
60+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/pull_request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
with:
1717
run-on: ubuntu-latest
1818
task: linuxAllTest
19+
upload-code-coverage: true
1920
check-macos:
2021
uses: ./.github/workflows/check.yml
2122
with:

.github/workflows/snapshot_release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,9 @@ jobs:
4343
--no-daemon
4444
--info
4545
build
46-
publish
46+
publish
47+
koverXmlReport
48+
- name: Upload coverage reports to Codecov
49+
uses: codecov/codecov-action@v3
50+
env:
51+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

test-suites/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ kotlin {
121121
}
122122
}
123123

124+
dependencies {
125+
kover(project(":"))
126+
}
127+
124128
private val remotesFile = file("$buildDir/remotes.json")
125129

126130
val generateRemoteSchemas =

0 commit comments

Comments
 (0)