Skip to content

Commit

Permalink
빌드시 테스트 태스크 제외시키고 CI에서만 돌리기 (#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
l2hyunwoo authored Oct 20, 2024
1 parent 68b15eb commit 6177d50
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/android-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/android-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -32,6 +33,12 @@ class FeaturePlugin: Plugin<Project> {
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"
}
}
}
}

0 comments on commit 6177d50

Please sign in to comment.