Codacy integration (#87)

This commit is contained in:
Ryan Brink
2021-10-04 18:17:25 -05:00
committed by GitHub
parent 5a7e052ac4
commit 91a6164663
7 changed files with 70 additions and 2 deletions

View File

@ -37,3 +37,28 @@ jobs:
run: ./gradlew assemble run: ./gradlew assemble
- name: Run Unit Tests - name: Run Unit Tests
run: ./gradlew test 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 }}

View File

@ -24,3 +24,23 @@ jobs:
run: ./gradlew publishAllPublicationsToGithubPackagesRepository run: ./gradlew publishAllPublicationsToGithubPackagesRepository
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 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 }}

View File

@ -1,5 +1,11 @@
# Changelog # Changelog
## [1.8.1] - October 4th, 2021
### Added
- Codacy integration
## [1.8.0] - October 4th, 2021 ## [1.8.0] - October 4th, 2021
### Changed ### Changed

View File

@ -30,6 +30,7 @@ allprojects {
apply(plugin = "io.gitlab.arturbosch.detekt") apply(plugin = "io.gitlab.arturbosch.detekt")
apply(plugin = "com.adarshr.test-logger") apply(plugin = "com.adarshr.test-logger")
apply(plugin = "idea") apply(plugin = "idea")
apply(plugin = "jacoco")
tasks.withType<KotlinCompile>().configureEach { tasks.withType<KotlinCompile>().configureEach {
kotlinOptions { kotlinOptions {
@ -37,6 +38,21 @@ allprojects {
} }
} }
tasks.withType<Test>() {
finalizedBy(tasks.withType(JacocoReport::class))
}
tasks.withType<JacocoReport>() {
reports {
html.required.set(true)
xml.required.set(true)
}
}
configure<JacocoPluginExtension> {
toolVersion = "0.8.7"
}
configure<TestLoggerExtension> { configure<TestLoggerExtension> {
theme = ThemeType.MOCHA theme = ThemeType.MOCHA
setLogLevel("lifecycle") setLogLevel("lifecycle")

View File

@ -1,5 +1,5 @@
# Kompendium # Kompendium
project.version=1.8.0 project.version=1.8.1
# Kotlin # Kotlin
kotlin.code.style=official kotlin.code.style=official
# Gradle # Gradle

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists 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 zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -1,4 +1,5 @@
rootProject.name = "kompendium" rootProject.name = "kompendium"
include("kompendium-core") include("kompendium-core")
include("kompendium-auth") include("kompendium-auth")
include("kompendium-swagger-ui") include("kompendium-swagger-ui")