Merge pull request #18 from open-feature/coverage

Add coverage validation
This commit is contained in:
Justin Abrahms 2022-06-14 11:38:51 -07:00 committed by GitHub
commit df24d2bea8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 2 deletions

View File

@ -31,6 +31,14 @@ jobs:
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
with: with:
arguments: build arguments: build
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
directory: lib/build
flags: unittests # optional
name: coverage # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in # The USERNAME and TOKEN need to correspond to the credentials environment variables used in
# the publishing section of your build.gradle # the publishing section of your build.gradle
- name: Publish to Sonatype (Maven) - name: Publish to Sonatype (Maven)

View File

@ -31,3 +31,11 @@ jobs:
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
with: with:
arguments: build arguments: build
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
directory: lib/build
flags: unittests # optional
name: pr coverage # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)

View File

@ -13,6 +13,7 @@ plugins {
id 'pmd' id 'pmd'
id 'maven-publish' id 'maven-publish'
id 'signing' id 'signing'
id 'jacoco'
} }
pmd { pmd {
@ -44,6 +45,16 @@ tasks.named('test') {
useJUnitPlatform() useJUnitPlatform()
} }
test {
finalizedBy jacocoTestReport // report is always generated after tests run
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
reports {
xml.required = true
}
}
task sourcesJar(type: Jar, dependsOn: classes) { task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources' archiveClassifier = 'sources'
archiveBaseName = 'openfeature' archiveBaseName = 'openfeature'
@ -54,7 +65,6 @@ artifacts {
archives sourcesJar archives sourcesJar
} }
jar.archiveBaseName = 'openfeature' jar.archiveBaseName = 'openfeature'
def repo_url = System.getenv("REPOSITORY_URL") def repo_url = System.getenv("REPOSITORY_URL")