diff --git a/.github/workflows/android ci.yml b/.github/workflows/android ci.yml index f47a015..69cff87 100644 --- a/.github/workflows/android ci.yml +++ b/.github/workflows/android ci.yml @@ -1,26 +1,26 @@ -name: Android CI - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up JDK - uses: actions/setup-java@v3 - with: - java-version: 17 - distribution: temurin - - - name: code quality with deteckt - run: ./gradlew detektFormat - - - name: test - run: ./gradlew test - - - name: build app - run: ./gradlew build +name: Android CI + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: temurin + + - name: code quality with deteckt + run: ./gradlew detekt + + - name: test + run: ./gradlew test + + - name: build app + run: ./gradlew build diff --git a/app/build.gradle b/app/build.gradle index cab949b..62855fc 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -129,10 +129,20 @@ dependencies { apply plugin: "org.jlleitschuh.gradle.ktlint" +detekt { + buildUponDefaultConfig = true + allRules = false + baseline = file("detekt-baseline.xml") +} + +tasks.withType(Detekt).configureEach { + jvmTarget = "1.8" +} + tasks.register('detektFormat', Detekt) { description = "Runs autocorrect enabled detekt build." source = files("src/main/java") - config.from(files("$rootDir/Scripts/detekt-config.yml")) + baseline = file("detekt-baseline.xml") autoCorrect = true reports { html {