Skip to content

Conversation

@ikseong00
Copy link
Contributor

@ikseong00 ikseong00 commented Sep 18, 2025

🚀 이슈번호

✏️ 변경사항

  • ci.yml 파일 생성

숨겨야 할 중요 값 정보가 있으면 추후 ci.yml 파일 수정이 필요하고, Github Secret 에 넣어야 합니다.
ex) baseUrl, google-services.json ...

Summary by CodeRabbit

  • Chores
    • GitHub Actions 기반 CI 파이프라인을 추가하여 Android/iOS 빌드를 자동화했습니다.
    • main/develop 브랜치에 대한 push 및 PR(오픈/동기화/재오픈) 시 빌드가 실행됩니다.
    • 일관된 JDK 및 Xcode 환경을 설정하고 빌드 캐시를 활용해 빌드 시간을 단축했습니다.
    • Android 디버그/릴리스 APK와 iOS 시뮬레이터/디바이스용 아티팩트를 생성합니다.
    • 빌드 실패 시 자세한 스택트레이스를 제공해 문제 파악이 용이합니다.

This commit introduces a GitHub Actions workflow that automates the build process for both Android and iOS platforms.

The workflow includes the following jobs:
- `android-build`: Builds debug and release APKs for Android.
- `ios-build`: Builds the iOS framework for simulator and device, and builds the iOS app.

Key steps in the workflow include:
- Checking out the code.
- Setting up JDK 11.
- Granting execute permission for gradlew.
- Caching Gradle packages to speed up subsequent builds.
- Running the respective build commands for Android and iOS.
- For iOS, it also sets up Xcode.
@ikseong00 ikseong00 self-assigned this Sep 18, 2025
@ikseong00 ikseong00 added the CI label Sep 18, 2025
@coderabbitai
Copy link

coderabbitai bot commented Sep 18, 2025

Walkthrough

새 GitHub Actions CI 워크플로우(.github/workflows/ci.yml)를 추가해 main/develop의 push 및 pull_request에서 Android(ubuntu-latest)와 iOS(macos-latest) 빌드를 병렬로 실행하도록 구성했습니다. JDK 17 설정, Gradle 캐시, 권한 부여 및 각 플랫폼별 빌드 명령을 포함합니다.

Changes

Cohort / File(s) Summary of Changes
CI Workflow 추가
.github/workflows/ci.yml
GitHub Actions 워크플로우 신설. 트리거: push, pull_request (main, develop). Job: android-build(ubuntu-latest) — checkout, setup JDK 17, gradle 캐시, chmod gradlew, ./gradlew assembleDebug/assembleRelease --stacktrace. Job: ios-build(macos-latest) — checkout, setup JDK 17, select Xcode, gradle 캐시, chmod gradlew, ./gradlew linkDebugFrameworkIosSimulatorArm64/linkDebugFrameworkIosArm64 --stacktrace, cd iosApp && xcodebuild (Simulator, CODE_SIGNING_ALLOWED=NO).

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Dev as 개발자
    participant GH as GitHub
    participant WF as CI Workflow
    participant A as Android Runner (ubuntu-latest)
    participant I as iOS Runner (macos-latest)

    Dev->>GH: push / pull_request (main, develop)
    GH->>WF: 워크플로우 트리거
    par 병렬 실행
        WF->>A: android-build 시작
        A->>A: checkout, setup JDK 17, gradle 캐시, chmod gradlew
        A->>A: ./gradlew assembleDebug --stacktrace
        A->>A: ./gradlew assembleRelease --stacktrace
        WF->>I: ios-build 시작
        I->>I: checkout, setup JDK 17, select Xcode, gradle 캐시, chmod gradlew
        I->>I: ./gradlew linkDebugFrameworkIosSimulatorArm64 --stacktrace
        I->>I: ./gradlew linkDebugFrameworkIosArm64 --stacktrace
        I->>I: cd iosApp && xcodebuild (Simulator, CODE_SIGNING_ALLOWED=NO)
    end
    WF-->>GH: 빌드 결과 보고
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

브랜치에 푸시되면 루틴이 깨어나
Gradle은 춤추고 Xcode는 창을 열어
권한 주고, 캐시 채워, 빌드가 흐르네 ⚙️
시뮬레이터도 달리고 APK는 포장돼 📦
CI의 밤, 로그가 조용히 빛나네 ✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed 제목 "[CI] ci.yml 파일 생성"은 PR의 핵심 변경사항인 CI 워크플로우 파일 추가를 명확히 나타내며 불필요한 잡음 없이 간결합니다. raw_summary에 따르면 .github/workflows/ci.yml이 추가되어 Android 및 iOS 빌드 잡을 포함하고 있어 제목이 변경의 주된 포인트를 잘 요약합니다. 따라서 타이틀은 적절하고 명확합니다.
Linked Issues Check ✅ Passed 이 PR은 이슈 #13의 요구사항인 CI YAML 파일 생성을 충족합니다: raw_summary와 PR 설명 모두 .github/workflows/ci.yml에 Android assembleDebug/Release와 iOS 시뮬레이터·디바이스 프레임워크 및 Xcode 앱 빌드 작업이 포함되어 있음을 보여주며 코드 변경은 CI 구성 파일 추가에 집중되어 있습니다. TODO 항목(안드로이드 CI, iOS CI)과 일치하는 구현이 존재합니다. 비밀값 처리 안내는 포함되어 있으나 이는 비코딩 구성사항으로 본 체크의 코딩 관련 목표 달성에는 영향이 없습니다.
Out of Scope Changes Check ✅ Passed 변경 내용은 .github/workflows/ci.yml 파일 추가에 국한되어 있고 raw_summary에 "No exported/public declarations modified"로 명시되어 있어 소스 코드나 공개 API 변경 등 링크된 이슈 범위를 벗어나는 변경은 발견되지 않습니다. 추가된 항목이 워크플로우 구성에만 해당하므로 범위 외 변경으로 보이지 않습니다. 전반적으로 PR은 의도된 목표 내에서 머물러 있습니다.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci/android-ios

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (11)
.github/workflows/ci.yml (11)

3-8: 트리거 범위 확인: feature 브랜치 push는 빌드 안 돼요

push 트리거가 main/develop만 포함해 feature/* 브랜치에 직접 push 시 CI가 돌지 않습니다. 의도라면 OK, 아니라면 아래처럼 브랜치 패턴을 넓히거나 paths 조건을 추가해 주세요.

 on:
   push:
-    branches: [ main, develop ]
+    branches:
+      - main
+      - develop
+      - 'feature/**'
   pull_request:
     branches: [ main, develop ]
     types: [ opened, synchronize, reopened ]

11-12: OS 러너 pin 권장

ubuntu-latest 롤링 업그레이드로 빌드가 예고 없이 깨질 수 있습니다. 안정성을 위해 LTS로 pin 해주세요. 타임아웃도 설정 권장.

-  android-build:
-    runs-on: ubuntu-latest
+  android-build:
+    runs-on: ubuntu-22.04
+    timeout-minutes: 30

27-36: Gradle 캐시 스텝 교체 제안: wrapper 검증 + 공식 Gradle 액션

actions/cache 수동 키 관리 대신 Gradle 공식 액션이 더 정확하고 안전합니다. wrapper 검증도 같이 넣어주세요.

-    - name: Cache Gradle packages
-      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: Validate Gradle Wrapper
+      uses: gradle/wrapper-validation-action@v2
+
+    - name: Setup Gradle
+      uses: gradle/actions/setup-gradle@v3

같은 변경을 iOS job에도 적용해 주세요.

Also applies to: 62-71


37-41: Release APK 빌드 실패 가능성(사인 키 불필요/미설정 시)

assembleRelease는 서명 설정 없으면 실패합니다. 의도적으로 빌드만 검증하려면 Debug만 빌드하거나, 조건부로 Release를 분리하세요.

-    - name: Build Android Release APK
-      run: ./gradlew assembleRelease --stacktrace
+    - name: Build Android Release APK (optional)
+      if: ${{ vars.BUILD_RELEASE == 'true' }}
+      run: ./gradlew assembleRelease --stacktrace --no-daemon

추가로 CI에서는 --no-daemon 사용을 권장합니다.


43-45: macOS/Xcode 버전 고정

macos-latest/Xcode 기본 경로 고정은 변동성 큽니다. 러너 이미지와 Xcode를 명시적으로 pin 하세요. setup-xcode 액션 사용을 추천합니다.

-  ios-build:
-    runs-on: macos-latest
+  ios-build:
+    runs-on: macos-14
+    timeout-minutes: 45
@@
-    - name: Select Xcode
-      run: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
+    - name: Setup Xcode
+      uses: maxim-lobanov/setup-xcode@v1
+      with:
+        xcode-version: '15.4'

버전은 프로젝트 호환 범위로 조정해 주세요.

Also applies to: 56-58


62-71: Kotlin/Native(Konan) 캐시 추가로 iOS/KMP 빌드 가속

KMP라면 ~/.konan 캐싱이 효과 큽니다.

     - name: Cache Gradle packages
       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: Cache Kotlin/Native (Konan)
+      uses: actions/cache@v4
+      with:
+        path: ~/.konan
+        key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
+        restore-keys: |
+          ${{ runner.os }}-konan-

78-81: iOS 빌드 안정화 + 아티팩트 업로드 추가 제안

  • destination의 OS=latest는 간헐적 실패 유발. 핀 또는 동적 조회 권장.
  • 빌드 산출물 업로드로 디버깅/공유 편의성↑.
     - name: Build iOS App
       run: |
-        cd iosApp
-        xcodebuild -project iosApp.xcodeproj -scheme iosApp -destination 'platform=iOS Simulator,name=iPhone 15,OS=latest' build CODE_SIGNING_ALLOWED=NO
+        set -eo pipefail
+        cd iosApp
+        xcrun simctl list runtimes
+        xcodebuild -project iosApp.xcodeproj \
+          -scheme iosApp \
+          -configuration Debug \
+          -destination 'platform=iOS Simulator,name=iPhone 15' \
+          -sdk iphonesimulator \
+          CODE_SIGNING_ALLOWED=NO \
+          build
+
+    - name: Upload Android APKs
+      if: always()
+      uses: actions/upload-artifact@v4
+      with:
+        name: android-apks
+        path: |
+          **/build/outputs/apk/**/debug/*.apk
+          **/build/outputs/apk/**/release/*.apk
+
+    - name: Upload iOS build products
+      if: always()
+      uses: actions/upload-artifact@v4
+      with:
+        name: ios-build
+        path: |
+          iosApp/build/**/*.app
+          **/build/bin/**/debugFramework/**

1-1: 권한 최소화와 중복 실행 취소(concurrency) 제안

워크플로우 전역 권한을 최소화하고 동일 ref의 중복 실행을 취소해 리소스 절약하세요.

 name: CI
+
+permissions:
+  contents: read
+
+concurrency:
+  group: ci-${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true

37-38: Gradle 플래그: CI 친화 옵션 추가

--no-daemon --warning-mode all -Dorg.gradle.parallel=true 등 CI 친화 플래그 권장.

-      run: ./gradlew assembleDebug --stacktrace
+      run: ./gradlew assembleDebug --stacktrace --no-daemon -Dorg.gradle.parallel=true
@@
-      run: ./gradlew linkDebugFrameworkIosArm64 --stacktrace
+      run: ./gradlew linkDebugFrameworkIosArm64 --stacktrace --no-daemon -Dorg.gradle.parallel=true

Also applies to: 75-76


81-81: EOF 개행 누락

파일 끝에 개행이 없습니다. 일부 linters에서 실패합니다.

-        xcodebuild -project iosApp.xcodeproj -scheme iosApp -destination 'platform=iOS Simulator,name=iPhone 15,OS=latest' build CODE_SIGNING_ALLOWED=NO
+        xcodebuild -project iosApp.xcodeproj -scheme iosApp -destination 'platform=iOS Simulator,name=iPhone 15,OS=latest' build CODE_SIGNING_ALLOWED=NO
+

72-77: KMP iOS 타깃·프레임워크 task 확인 — 워크플로우 명령 유효함

composeApp/build.gradle.kts(약 23–27)에서 iosX64(), iosArm64(), iosSimulatorArm64()와 iosTarget.binaries.framework가 선언되어 있으므로 .github/workflows/ci.yml의 ./gradlew linkDebugFrameworkIosSimulatorArm64 및 ./gradlew linkDebugFrameworkIosArm64 호출은 타깃 이름과 일치합니다.

선택사항: 여러 타깃을 통합 빌드하려면 :shared:createXCFramework 사용 고려.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3fe779 and 9c534bc.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/ci.yml

[error] 81-81: no new line character at the end of file

(new-line-at-end-of-file)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: android-build
  • GitHub Check: ios-build
🔇 Additional comments (1)
.github/workflows/ci.yml (1)

15-23: 체크아웃/Java 설정은 적절합니다

JDK 17(Temurin) 설정과 checkout@v4 사용은 목적에 맞습니다.


steps:
- name: Checkout code
uses: actions/checkout@v4
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

액션 버전 tag 대신 커밋 SHA pin 권장

서플라이 체인 리스크 완화를 위해 @v4/@v3 태그 대신 커밋 SHA로 pin 하세요. GitHub 보안 가이드가 권장합니다.

예)

-uses: actions/checkout@v4
+uses: actions/checkout@<commit-sha>

필요 시 제가 현재 권장 SHA 목록 드릴게요.

Also applies to: 19-19, 28-28, 48-48, 51-51, 63-63

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
.github/workflows/ci.yml (1)

16-16: 액션 버전 태그 대신 커밋 SHA로 pin 하세요

서플라이 체인 리스크 완화 및 재현성 확보를 위해 @v4 태그 대신 커밋 SHA 고정 권장합니다. 아래 예시처럼 모든 uses:에 적용해주세요.

-uses: actions/checkout@v4
+uses: actions/checkout@<commit-sha>

-uses: actions/setup-java@v4
+uses: actions/setup-java@<commit-sha>

-uses: actions/cache@v4
+uses: actions/cache@<commit-sha>

원하시면 현재 권장 SHA 목록 드릴게요.

Also applies to: 19-19, 28-28, 48-48, 51-51, 63-63

🧹 Nitpick comments (9)
.github/workflows/ci.yml (9)

3-9: 동시 실행 취소(concurrency)로 중복 빌드 낭비 방지

동일 브랜치로 연속 푸시 시 이전 작업 자동 취소 설정을 추가하면 CI 시간 절약됩니다.

 on:
   push:
     branches: [ main, develop ]
   pull_request:
     branches: [ main, develop ]
     types: [ opened, synchronize, reopened ]
+
+concurrency:
+  group: ci-${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true

12-12: 호스트 러너 버전 고정 권장

ubuntu-latest, macos-latest는 예기치 않은 이미지 변경으로 빌드가 깨질 수 있습니다. 안정성 위해 명시 버전으로 고정 검토해주세요(예: ubuntu-24.04, macos-14 등).

Also applies to: 44-44


18-23: Gradle 캐시 방식 단순화: setup-java의 내장 캐시 사용

수동 actions/cache 대신 actions/setup-javacache: 'gradle' 옵션을 쓰면 키 관리가 단순해지고 실수 위험이 줄어듭니다. 두 잡 모두에 적용해주세요.

 - name: Set up JDK 17
-uses: actions/setup-java@v4
+uses: actions/setup-java@<commit-sha>
   with:
     java-version: '17'
     distribution: 'temurin'
+    cache: 'gradle'
 
-# (삭제) 수동 Gradle 캐시 단계
-- name: Cache Gradle packages
-  uses: actions/cache@<commit-sha>
-  with:
-    path: |
-      ~/.gradle/caches
-      ~/.gradle/wrapper
-    key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
-    restore-keys: |
-      ${{ runner.os }}-gradle-

iOS 잡(5155, 6271)에도 동일하게 적용 바랍니다.

Also applies to: 27-36, 50-55, 62-71


15-16: Gradle Wrapper 무결성 검증 추가

서드파티 PR/디펜던시 공격 대비를 위해 Gradle Wrapper 검증 액션을 체크아웃 직후에 추가하세요.

 - name: Checkout code
-  uses: actions/checkout@v4
+  uses: actions/checkout@<commit-sha>
+
+ - name: Validate Gradle Wrapper
+   uses: gradle/wrapper-validation-action@<commit-sha>

Also applies to: 47-48


10-10: 레포 권한 최소화(permissions) 기본값 명시

워크플로우 상단에 최소 권한을 명시해 토큰 오남용 위험을 낮추세요.

 jobs:
+permissions:
+  contents: read

필요 시 잡 단위로 추가 권한을 올려주세요.


37-42: 빌드 성과물 업로드로 디버깅/공유 편의성 향상

APK, KMM 프레임워크, Xcode 빌드 산출물(로그/앱)을 아티팩트로 업로드하면 실패 시 분석이 쉬워집니다.

 - name: Build Android Release APK
   run: ./gradlew assembleRelease --stacktrace
+ - name: Upload Android APKs
+   uses: actions/upload-artifact@<commit-sha>
+   with:
+     name: android-apks
+     path: |
+       app/build/outputs/apk/**/**.apk
+     retention-days: 7

 - name: Build iOS Framework for Simulator
   run: ./gradlew linkDebugFrameworkIosSimulatorArm64 --stacktrace
 - name: Build iOS Framework for Device
   run: ./gradlew linkDebugFrameworkIosArm64 --stacktrace
+ - name: Upload KMM Frameworks
+   uses: actions/upload-artifact@<commit-sha>
+   with:
+     name: kmm-frameworks
+     path: |
+       **/build/bin/**/linkDebugFramework*/**
+     retention-days: 7

 - name: Build iOS App
   run: |
     cd iosApp
     xcodebuild -project iosApp.xcodeproj -scheme iosApp -destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' build CODE_SIGNING_ALLOWED=NO
+ - name: Upload iOS build logs
+   if: always()
+   uses: actions/upload-artifact@<commit-sha>
+   with:
+     name: xcode-logs
+     path: ~/Library/Logs/DiagnosticReports/**/*
+     retention-days: 7

Also applies to: 72-77, 78-81


78-81: iOS 빌드 전 의존성 확인(Pods 등)

프로젝트가 CocoaPods/SwiftPM 사용 시 pod install 또는 xcodebuild -resolvePackageDependencies가 필요할 수 있습니다. 현재 단계엔 누락되어 있어 환경에 따라 빌드 실패 가능성이 있습니다.


1-1: 보안/비밀값 처리 가이드

baseUrl, google-services.json 등 민감 정보는 GitHub Secrets/Actions variables로 주입하고 파일은 런타임에 생성하세요. 예: secret를 파일로 쓰기.

- name: Write google-services.json
  run: |
    mkdir -p android/app/src/debug
    echo "${{ secrets.GOOGLE_SERVICES_JSON_DEBUG }}" > android/app/src/debug/google-services.json

필요 시 환경별 분리와 시크릿 회전 전략 같이 잡아드릴게요.


81-81: 파일 끝 개행 누락

YAMLlint 오류가 있습니다. EOF 개행 추가해주세요.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9c534bc and 7aeeddc.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/ci.yml

[error] 81-81: no new line character at the end of file

(new-line-at-end-of-file)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: ios-build
🔇 Additional comments (1)
.github/workflows/ci.yml (1)

56-58: Xcode 버전·시뮬레이터 고정 필요 — macOS 러너 이미지별 설치 차이로 빌드 실패 가능

  • 문제: 현재 .github/workflows/ci.yml에서 sudo xcode-select로 시스템 Xcode를 선택하고 있는데, GitHub 호스티드 macOS 러너에 설치된 Xcode/시뮬레이터는 이미지(macos-14, macos-15, macos-latest 등)에 따라 달라 'iPhone 16' 시뮬레이터가 없으면 xcodebuild -destination이 실패합니다.
  • 위치: .github/workflows/ci.yml — 56-58 (및 동일 이슈가 78-81에 적용)

권장 수정:

- - name: Select Xcode
-   run: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
+ - name: Select Xcode 16.x
+   uses: maxim-lobanov/setup-xcode@<commit-sha>
+   with:
+     xcode-version: '16.x'

  - name: Build iOS App
    run: |
-     cd iosApp
-     xcodebuild -project iosApp.xcodeproj -scheme iosApp -destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' build CODE_SIGNING_ALLOWED=NO
+     cd iosApp
+     xcodebuild \
+       -project iosApp.xcodeproj \
+       -scheme iosApp \
+       -destination 'platform=iOS Simulator,OS=latest,name=iPhone 16' \
+       -configuration Debug \
+       CODE_SIGNING_ALLOWED=NO \
+       build

확인 요청: 사용 중인 러너 이미지(macos-14 / macos-15 / macos-latest 등)와 확인 시점을 알려주세요. 해당 이미지의 설치된 Xcode 버전 및 시뮬레이터 목록을 확인해 정확한 xcode-version과 시뮬레이터 이름(OS)을 제안하겠습니다.

@ikseong00 ikseong00 merged commit 4530a17 into develop Sep 18, 2025
3 checks passed
@ikseong00 ikseong00 deleted the ci/android-ios branch September 18, 2025 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] Android, iOS CI 파일 생성

2 participants