Skip to content

Commit

Permalink
[IDLE-000] CI Test
Browse files Browse the repository at this point in the history
  • Loading branch information
tgyuuAn committed Oct 28, 2024
1 parent a73966e commit 35ce5d6
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 18 deletions.
46 changes: 39 additions & 7 deletions .github/workflows/android_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Android CI

on:
push:
branches: [ "develop", "main" ]
branches: [ "develop" ]
pull_request:
branches: [ "develop", "main" ]
branches: [ "develop" ]

jobs:
build:
Expand All @@ -13,7 +13,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: set up JDK 17
- name: Gradle cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
Expand All @@ -22,12 +32,34 @@ jobs:

- name: Grant execute permission for gradlew
run: chmod +x gradlew


- name: Set up local.properties
run: |
echo "CARE_DEV_BASE_URL=${{ secrets.CARE_DEV_BASE_URL }}" >> local.properties
echo "CARE_PROD_BASE_URL=${{ secrets.CARE_PROD_BASE_URL }}" >> local.properties
echo "NAVER_BASE_URL=${{ secrets.NAVER_BASE_URL }}" >> local.properties
echo "NAVER_CLIENT_ID=${{ secrets.NAVER_CLIENT_ID }}" >> local.properties
echo "NAVER_CLIENT_SECRET=${{ secrets.NAVER_CLIENT_SECRET }}" >> local.properties
echo "AMPLITUDE_API_KEY=${{ secrets.AMPLITUDE_API_KEY }}" >> local.properties
- name: Set up keystore.properties
run: |
echo "STORE_FILE_PATH=./app/upload-keystore.jks" >> keystore.properties
echo "STORE_PASSWORD=${{ secrets.STORE_PASSWORD }}" >> keystore.properties
echo "KEY_ALIAS=${{ secrets.KEY_ALIAS }}" >> keystore.properties
echo "KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}" >> keystore.properties
- name: Decode keystore file
run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > ./app/upload-keystore.jks

- name: Create google-services.json
run: echo '${{ secrets.GOOGLE_SERVICES_JSON }}' > ./app/google-services.json

- name: Build with Gradle
run: ./gradlew build
run: ./gradlew assembleDebug --build-cache --stacktrace

- name: KtlintCheck
run: ./gradlew ktlintcheck

- name: UnitTest
run: ./gradlew test
- name: Test
run: ./gradlew test --stacktrace
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
.externalNativeBuild
.cxx
local.properties
gradle.properties
keystore.properties
/.kotlin/
/app/upload-keystore.jks
/app/upload-keystore.jks
/keystore.properties
21 changes: 13 additions & 8 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id("care.android.application")
id("care.android.binding")
id("com.google.firebase.crashlytics")
alias(libs.plugins.androidx.navigation.safeargs)
}

android {
Expand All @@ -16,23 +17,27 @@ android {

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

val properties = Properties()
properties.load(project.rootProject.file("local.properties").bufferedReader())
manifestPlaceholders["NAVER_CLIENT_ID"] = properties["NAVER_CLIENT_ID"] as String
val localProperties = Properties()
localProperties.load(project.rootProject.file("local.properties").bufferedReader())
manifestPlaceholders["NAVER_CLIENT_ID"] = localProperties["NAVER_CLIENT_ID"] as String

buildConfigField(
"String",
"AMPLITUDE_API_KEY",
"\"${properties["AMPLITUDE_API_KEY"]}\"",
"\"${localProperties["AMPLITUDE_API_KEY"]}\"",
)
}

signingConfigs {
create("release") {
storeFile = file(project.findProperty("STORE_FILE_PATH") as String)
storePassword = project.findProperty("STORE_PASSWORD") as String
keyAlias = project.findProperty("KEY_ALIAS") as String
keyPassword = project.findProperty("KEY_PASSWORD") as String
val keystoreProperties = Properties()
keystoreProperties.load(project.rootProject.file("keystore.properties").bufferedReader()
)

storeFile = file(keystoreProperties["STORE_FILE_PATH"] as String)
storePassword = keystoreProperties["STORE_PASSWORD"] as String
keyAlias = keystoreProperties["KEY_ALIAS"] as String
keyPassword = keystoreProperties["KEY_PASSWORD"] as String
}
}

Expand Down
Binary file modified app/release/app-release.aab
Binary file not shown.
23 changes: 23 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. For more details, visit
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
1 change: 0 additions & 1 deletion presentation/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id("care.android.feature-binding")
alias(libs.plugins.androidx.navigation.safeargs)
}

android {
Expand Down

0 comments on commit 35ce5d6

Please sign in to comment.