Skip to content

Commit

Permalink
refactor: 이미지 업로드 메서드 시그니처 번경
Browse files Browse the repository at this point in the history
  • Loading branch information
fromitive committed Nov 28, 2024
1 parent eaaae1e commit ae6fbc6
Show file tree
Hide file tree
Showing 113 changed files with 2,235 additions and 2,208 deletions.
82 changes: 9 additions & 73 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
name: Android CI CD
name: Android CI

on:
push:
branches: [ "develop-AN" ]
paths:
- 'android/**'
pull_request:
branches:
- "develop-AN"
- "release*"
branches: [ "develop-AN" ]
paths:
- 'android/**'

defaults:
run:
Expand Down Expand Up @@ -85,7 +89,7 @@ jobs:
echo "native_app_key=$NATIVE_APP_KEY" >> ./local.properties
- name: Set up JDK 17
uses: actions/setup-java@v4
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
Expand All @@ -102,71 +106,3 @@ jobs:

- name: Run Unit Test
run: ./gradlew test

deploy:
runs-on: ubuntu-latest
needs: build_and_test
if: startsWith(github.event.pull_request.base.ref, 'release-')
steps:
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

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

- name: Create google-services.json
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: |
echo "$GOOGLE_SERVICES_JSON" > app/google-services.json
- name: Create service_account.json
id: createServiceAccount
run: echo '${{ secrets.SERVICE_ACCOUNT_JSON }}' > app/service_account.json

- name: Set up environment variable for BuildConfig
env:
BASE_URL: ${{ secrets.BASE_URL }}
TOKEN: ${{ secrets.TOKEN }}
NATIVE_APP_KEY: ${{ secrets.NATIVE_APP_KEY }}
run: |
echo "base_url=$BASE_URL" >> ./local.properties
echo "token=$TOKEN" >> ./local.properties
echo "native_app_key=$NATIVE_APP_KEY" >> ./local.properties
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build release AAB
run: ./gradlew bundleRelease

- name: Sign AAB
id: sign
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: ./android/app/build/outputs/bundle/release
output: ./android/build/release/signed
signingKeyBase64: ${{ secrets.ENCODED_KEYSTORE }}
alias: ${{ secrets.AN_ALIAS }}
keyStorePassword: ${{ secrets.AN_KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.AN_KEY_PASSWORD }}

- name: Upload AAB to Google Play
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.zzang.chongdae
releaseFiles: ./android/app/build/outputs/bundle/release/app-release.aab
track: "총대마켓 - 비공개 테스트"
157 changes: 78 additions & 79 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ plugins {
id("com.google.gms.google-services")
kotlin("plugin.serialization") version "2.0.0"
id("com.google.firebase.crashlytics")
id("com.google.dagger.hilt.android")
}

android {
Expand All @@ -29,8 +28,8 @@ android {
applicationId = "com.zzang.chongdae"
minSdk = 26
targetSdk = 34
versionCode = 6
versionName = "1.1.4"
versionCode = 2
versionName = "1.1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments["runnerBuilder"] = "de.mannodermaus.junit5.AndroidJUnit5Builder"
Expand All @@ -50,7 +49,11 @@ android {

buildTypes {
debug {
isMinifyEnabled = false
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
}
release {
isMinifyEnabled = true
Expand Down Expand Up @@ -83,93 +86,89 @@ android {
}

dependencies {
val navigationVersion = "2.7.7"
val fragmentVersion = "1.8.1"
implementation("androidx.core:core-ktx:1.10.1")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.10.0")
implementation("androidx.activity:activity-ktx:1.8.2")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.test.ext:junit-ktx:1.1.5")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
testImplementation("org.assertj:assertj-core:3.25.3")
testImplementation("io.kotest:kotest-runner-junit5:5.8.0")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation("androidx.test:runner:1.4.0")
androidTestImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
androidTestImplementation("org.assertj:assertj-core:3.25.3")
androidTestImplementation("io.kotest:kotest-runner-junit5:5.8.0")
androidTestImplementation("de.mannodermaus.junit5:android-test-core:1.3.0")
androidTestRuntimeOnly("de.mannodermaus.junit5:android-test-runner:1.3.0")
// Testing Navigation
androidTestImplementation("androidx.navigation:navigation-testing:$navigationVersion")

implementation("androidx.room:room-runtime:2.6.1")
kapt("androidx.room:room-compiler:2.6.1")
implementation("androidx.room:room-ktx:2.6.1")
implementation("com.google.code.gson:gson:2.8.8")

implementation("com.github.bumptech.glide:glide:4.12.0")
kapt("com.github.bumptech.glide:compiler:4.12.0")
testImplementation("androidx.arch.core:core-testing:2.1.0")
implementation("com.squareup.okhttp3:mockwebserver:4.12.0")

implementation("com.squareup.retrofit2:retrofit:2.11.0")
implementation("com.squareup.retrofit2:converter-gson:2.11.0")

implementation("androidx.room:room-ktx:2.6.1")

implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.2")
implementation("com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0")

kapt("com.github.bumptech.glide:compiler:4.13.2")

implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.7.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0")
implementation("androidx.activity:activity-ktx:1.9.0")
implementation("androidx.fragment:fragment-ktx:1.7.0")
implementation("androidx.core:core-ktx:1.10.1")
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
implementation(libs.androidx.activity)
implementation(libs.androidx.fragment)
implementation(libs.androidx.constraintlayout)

// Test
implementation(libs.androidx.junit)
testImplementation(libs.junit.jupiter)
testImplementation(libs.assertj.core)
testImplementation(libs.kotest.runner.junit5)
testImplementation(libs.core.testing)

// Android Test
androidTestImplementation(libs.junit.jupiter)
androidTestImplementation(libs.assertj.core)
androidTestImplementation(libs.kotest.runner.junit5)
androidTestImplementation(libs.mannodermaus.test.core)
androidTestImplementation(libs.mannodermaus.test.runner)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.test.runner)

// Espresso 및 관련
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(libs.androidx.espresso.contrib)

// UI Test: Fragment Scenario
debugImplementation(libs.androidx.fragment.testing)
androidTestImplementation(libs.androidx.fragment.testing)

// DataStore
implementation(libs.androidx.datastore.preferences)

// Lifecycle
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.lifecycle.livedata.ktx)
implementation(libs.androidx.lifecycle.viewmodel.ktx)

// Room
implementation(libs.androidx.room.runtime)
kapt(libs.androidx.room.compiler)
implementation(libs.androidx.room.ktx)

// json
implementation(libs.kotlinx.serialization.json)

// Glide
implementation(libs.glide)
kapt(libs.glide.compiler)

// Retrofit
implementation(libs.retrofit)
implementation(libs.retrofit.converter.gson)
implementation(libs.retrofit.kotlinx.serialization)

// Navigation
implementation(libs.androidx.navigation.fragment)
implementation(libs.androidx.navigation.ui)
androidTestImplementation(libs.androidx.navigation.testing)
implementation("androidx.navigation:navigation-fragment-ktx:$navigationVersion")
implementation("androidx.navigation:navigation-ui-ktx:$navigationVersion")

// UI Test - Fragment Scenario
debugImplementation("androidx.fragment:fragment-testing-manifest:$fragmentVersion")
androidTestImplementation("androidx.fragment:fragment-testing:$fragmentVersion")

// Espresso
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation("androidx.test:runner:1.4.0")

// Espresso RecyclerView Actions
androidTestImplementation("androidx.test.espresso:espresso-contrib:3.3.0")

// Pagination
implementation(libs.androidx.paging.runtime)
implementation("androidx.paging:paging-runtime-ktx:3.3.0")

// WebView
implementation(libs.androidx.webkit)
implementation("androidx.webkit:webkit:1.9.0")

// Firebase
implementation(platform(libs.firebase.bom))
implementation(libs.firebase.analytics)
implementation(libs.firebase.crashlytics)
implementation(platform("com.google.firebase:firebase-bom:33.1.2"))
implementation("com.google.firebase:firebase-analytics")

// 카카오 로그인
implementation(libs.kakao.sdk)
implementation("com.kakao.sdk:v2-all:2.20.3")

// Mockk
implementation(libs.mockwebserver)
testImplementation(libs.mockk)
// data store
implementation("androidx.datastore:datastore-preferences:1.0.0")

// Swipe Refresh Layout
implementation(libs.androidx.swiperefreshlayout)

// Hilt
implementation(libs.hilt.android)
kapt(libs.hilt.compiler)
}
implementation("com.google.firebase:firebase-crashlytics")

kapt {
correctErrorTypes = true
// mockk
testImplementation("io.mockk:mockk:1.13.10")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.zzang.chongdae

import androidx.fragment.app.testing.FragmentScenario
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.zzang.chongdae.presentation.view.comment.CommentRoomsFragment
import org.junit.Before
import org.junit.Test
import org.junit.jupiter.api.DisplayName
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class CommentRoomsFragmentTest {
private lateinit var scenario: FragmentScenario<CommentRoomsFragment>

@Before
fun setUp() {
scenario = FragmentScenario.launchInContainer(CommentRoomsFragment::class.java)
}

@Test
@DisplayName("댓글방 목록으로 이동하면 채팅이라는 텍스트뷰가 보여야 한다")
fun commentRoomTest1() {
// then
onView(withId(R.id.tv_comment_text)).check(matches(isDisplayed()))
}
}
16 changes: 2 additions & 14 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,8 @@

<activity
android:name=".presentation.view.MainActivity"
android:exported="true"
android:windowSoftInputMode="stateAlwaysHidden|adjustPan">

<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="offerings"
android:pathPattern="/.*"
android:scheme="chongdaeapp" />
</intent-filter>
</activity>
android:exported="false"
android:windowSoftInputMode="stateAlwaysHidden|adjustPan" />

<activity
android:name=".presentation.view.commentdetail.CommentDetailActivity"
Expand Down
Loading

0 comments on commit ae6fbc6

Please sign in to comment.