diff --git a/.github/workflows/pr_checks.yml b/.github/workflows/pr_checks.yml index bdb5e99f2..bb192f490 100644 --- a/.github/workflows/pr_checks.yml +++ b/.github/workflows/pr_checks.yml @@ -37,3 +37,28 @@ jobs: run: ./gradlew assemble - name: Run Unit Tests run: ./gradlew test + - name: Cache Coverage Results + uses: actions/cache@v2 + with: + path: ./**/build/reports/jacoco + key: ${{ runner.os }}-unit-${{ env.GITHUB_SHA }} + upload-code-coverage: + runs-on: ubuntu-latest + needs: + - unit + steps: + - uses: actions/checkout@v2 + - name: Cache Coverage Results + uses: actions/cache@v2 + with: + path: ./**/build/reports/jacoco + key: ${{ runner.os }}-unit-${{ env.GITHUB_SHA }} + - name: Cache Coverage Results + uses: actions/cache@v2 + with: + path: ./**/build/reports/jacoco + key: ${{ runner.os }}-integration-${{ env.GITHUB_SHA }} + - name: Publish code coverage to Codacy + uses: codacy/codacy-coverage-reporter-action@v1 + with: + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8c4b6ae49..901052b15 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,3 +24,23 @@ jobs: run: ./gradlew publishAllPublicationsToGithubPackagesRepository env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + code-coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '11' + - name: Cache Gradle packages + uses: actions/cache@v2 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }} + restore-keys: ${{ runner.os }}-gradle + - name: Run Unit Tests + run: ./gradlew test + - name: Publish code coverage to Codacy + uses: codacy/codacy-coverage-reporter-action@v1 + with: + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 792983086..ac397dcd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [1.8.1] - October 4th, 2021 + +### Added + +- Codacy integration + ## [1.8.0] - October 4th, 2021 ### Changed diff --git a/build.gradle.kts b/build.gradle.kts index fbc80dfe9..20369e274 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -30,6 +30,7 @@ allprojects { apply(plugin = "io.gitlab.arturbosch.detekt") apply(plugin = "com.adarshr.test-logger") apply(plugin = "idea") + apply(plugin = "jacoco") tasks.withType().configureEach { kotlinOptions { @@ -37,6 +38,21 @@ allprojects { } } + tasks.withType() { + finalizedBy(tasks.withType(JacocoReport::class)) + } + + tasks.withType() { + reports { + html.required.set(true) + xml.required.set(true) + } + } + + configure { + toolVersion = "0.8.7" + } + configure { theme = ThemeType.MOCHA setLogLevel("lifecycle") diff --git a/gradle.properties b/gradle.properties index 74c3144eb..9f2e64eee 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Kompendium -project.version=1.8.0 +project.version=1.8.1 # Kotlin kotlin.code.style=official # Gradle diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f371643ee..ffed3a254 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index 548a4360a..ee0737744 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,4 +1,5 @@ rootProject.name = "kompendium" + include("kompendium-core") include("kompendium-auth") include("kompendium-swagger-ui")