From 6177d5019bdcd01166899b3c9472db8dd9d2ca8e Mon Sep 17 00:00:00 2001 From: "HyunWoo Lee (Nunu Lee)" <54518925+l2hyunwoo@users.noreply.github.com> Date: Sun, 20 Oct 2024 16:34:50 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=8C=EB=93=9C=EC=8B=9C=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=ED=83=9C=EC=8A=A4=ED=81=AC=20=EC=A0=9C?= =?UTF-8?q?=EC=99=B8=EC=8B=9C=ED=82=A4=EA=B3=A0=20CI=EC=97=90=EC=84=9C?= =?UTF-8?q?=EB=A7=8C=20=EB=8F=8C=EB=A6=AC=EA=B8=B0=20(#362)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/android-develop.yml | 4 ++-- .github/workflows/android-release.yml | 4 ++-- .../ku_ring/buildlogic/convention/FeaturePlugin.kt | 9 ++++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/android-develop.yml b/.github/workflows/android-develop.yml index 386167c08..5bd5b5aed 100644 --- a/.github/workflows/android-develop.yml +++ b/.github/workflows/android-develop.yml @@ -37,12 +37,12 @@ jobs: mkdir ./app/src/debug echo '${{ secrets.GOOGLE_SERVICES_JSON_DEBUG }}' > ./app/src/debug/google-services.json - - name: Create local.properteis + - name: Create local.properties run: echo '${{ secrets.LOCAL_PROPERTIES }}' > ./local.properties # Build Debug App - name: Build with Gradle - run: ./gradlew :app:assembleDebug + run: ./gradlew :app:assembleDebug -PisCI=true # Run unit test - name: Run unit test diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index e2bcb304a..2124847ee 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -48,11 +48,11 @@ jobs: # Build APK Release - name: Build release Apk - run: ./gradlew :app:assembleRelease + run: ./gradlew :app:assembleRelease -PisCI=true # Build AAB Release - name: Build release Bundle - run: ./gradlew :app:bundleRelease + run: ./gradlew :app:bundleRelease -PisCI=true # Upload AAB - name: Upload a Build AAB Artifact diff --git a/build-logic/src/main/kotlin/com/ku_stacks/ku_ring/buildlogic/convention/FeaturePlugin.kt b/build-logic/src/main/kotlin/com/ku_stacks/ku_ring/buildlogic/convention/FeaturePlugin.kt index eaa47bdb1..b4c40bf2c 100644 --- a/build-logic/src/main/kotlin/com/ku_stacks/ku_ring/buildlogic/convention/FeaturePlugin.kt +++ b/build-logic/src/main/kotlin/com/ku_stacks/ku_ring/buildlogic/convention/FeaturePlugin.kt @@ -1,13 +1,14 @@ package com.ku_stacks.ku_ring.buildlogic.convention -import com.android.build.api.dsl.ApplicationExtension import com.android.build.api.dsl.LibraryExtension +import com.android.build.gradle.tasks.factory.AndroidUnitTest import com.ku_stacks.ku_ring.buildlogic.dsl.configureAndroidLibrary import com.ku_stacks.ku_ring.buildlogic.primitive.CommonAndroidPlugin import com.ku_stacks.ku_ring.buildlogic.primitive.HiltPlugin import com.ku_stacks.ku_ring.buildlogic.primitive.KotlinPlugin import org.gradle.api.Plugin import org.gradle.api.Project +import org.gradle.api.tasks.testing.Test import org.gradle.kotlin.dsl.apply import org.gradle.kotlin.dsl.configure @@ -32,6 +33,12 @@ class FeaturePlugin: Plugin { proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") } } + tasks.withType(Test::class.java).configureEach { + enabled = project.hasProperty("isCI") && project.property("isCI") == "true" + } + tasks.withType(AndroidUnitTest::class.java).configureEach { + enabled = project.hasProperty("isCI") && project.property("isCI") == "true" + } } } }