From 517be473973b95edb8e5bcdcfc3f150b1eba8477 Mon Sep 17 00:00:00 2001 From: Jorge Martin Espinosa Date: Fri, 15 Mar 2024 18:03:13 +0100 Subject: [PATCH] Move `Konsist` tests to quality checks (#2558) * Move `Konsist` tests to quality checks This should also help us avoid running them for every single test task, including Kover. * Fix upload report path filter --- .github/workflows/quality.yml | 2 +- build.gradle.kts | 1 + tests/konsist/build.gradle.kts | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 3848191bf7..dfd5315c9f 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -63,7 +63,7 @@ jobs: with: name: linting-report path: | - */build/reports/**/*.* + **/build/reports/**/*.* - name: Prepare Danger if: always() run: | diff --git a/build.gradle.kts b/build.gradle.kts index 1c00dca436..1d82d0d1a6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -172,6 +172,7 @@ allprojects { // Register quality check tasks. tasks.register("runQualityChecks") { + dependsOn(":tests:konsist:testDebugUnitTest") project.subprojects { // For some reason `findByName("lint")` doesn't work tasks.findByPath("$path:lint")?.let { dependsOn(it) } diff --git a/tests/konsist/build.gradle.kts b/tests/konsist/build.gradle.kts index 1ce4e9f232..591d89626f 100644 --- a/tests/konsist/build.gradle.kts +++ b/tests/konsist/build.gradle.kts @@ -33,9 +33,11 @@ dependencies { testImplementation(projects.libraries.designsystem) } -// Make sure Konsist tests are always run. This is needed because otherwise we'd have to either: +// Make sure Konsist tests run for 'check' tasks. This is needed because otherwise we'd have to either: // - Add every single module as a dependency of this one. // - Move the Konsist tests to the `app` module, but the `app` module does not need to know about Konsist. tasks.withType().configureEach { - outputs.upToDateWhen { false } + outputs.upToDateWhen { + gradle.startParameter.taskNames.any { it.contains("check", ignoreCase = true).not() } + } }