Skip to content

Commit

Permalink
feat: Qodana
Browse files Browse the repository at this point in the history
  • Loading branch information
dineug committed Jan 19, 2024
1 parent 59c80b7 commit cae5f18
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 43 deletions.
44 changes: 1 addition & 43 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,48 +93,6 @@ jobs:
name: ${{ steps.artifact.outputs.filename }}
path: ./build/distributions/content/*/*

# Run tests and upload a code coverage report
test:
name: Test
needs: [ build ]
runs-on: ubuntu-latest
steps:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17

# Setup Gradle
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true

# Run tests
- name: Run Tests
run: ./gradlew check

# Collect Tests Result of failed tests
- name: Collect Tests Result
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: tests-result
path: ${{ github.workspace }}/build/reports/tests

# Upload the Kover report to CodeCov
- name: Upload Code Coverage Report
uses: codecov/codecov-action@v3
with:
files: ${{ github.workspace }}/build/reports/kover/report.xml

# Run Qodana inspections and provide report
inspectCode:
name: Inspect code
Expand Down Expand Up @@ -166,7 +124,7 @@ jobs:

# Run Qodana inspections
- name: Qodana - Code Inspection
uses: JetBrains/qodana-action@v2023.2.8
uses: JetBrains/qodana-action@v2023.3.0
with:
cache-default-branch-only: true

Expand Down
9 changes: 9 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins {
alias(libs.plugins.kotlin) // Kotlin support
alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
alias(libs.plugins.changelog) // Gradle Changelog Plugin
alias(libs.plugins.qodana) // Gradle Qodana Plugin
alias(libs.plugins.kover) // Gradle Kover Plugin
}

Expand Down Expand Up @@ -50,6 +51,14 @@ changelog {
repositoryUrl = properties("pluginRepositoryUrl")
}

// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
qodana {
cachePath = provider { file(".qodana").canonicalPath }
reportPath = provider { file("build/reports/inspections").canonicalPath }
saveReport = true
showReport = environment("QODANA_SHOW_REPORT").map { it.toBoolean() }.getOrElse(false)
}

// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
koverReport {
defaults {
Expand Down
12 changes: 12 additions & 0 deletions qodana.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Qodana configuration:
# https://www.jetbrains.com/help/qodana/qodana-yaml.html

version: 1.0
linter: jetbrains/qodana-jvm-community:latest
projectJDK: "17"
profile:
name: qodana.recommended
exclude:
- name: All
paths:
- .qodana

0 comments on commit cae5f18

Please sign in to comment.