Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Android CI/CD

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

jobs:
build-and-test:
runs-on: ubuntu-latest

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

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

- 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: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew assembleDebug

- name: Run unit tests
run: ./gradlew test

- name: Upload test reports
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports
path: app/build/reports/tests/

distribute:
needs: build-and-test # build-and-test가 성공해야 실행
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop') # push to main/develop만
runs-on: ubuntu-latest

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

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
bundler-cache: true

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

- 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: Decode Firebase service account
env:
FIREBASE_SECRET: ${{ secrets.FIREBASE_SECRET }}
run: |
echo $FIREBASE_SECRET | base64 --decode > firebase-service-account.json
Comment on lines +80 to +85
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Quote the secret before decoding.

Use echo "$FIREBASE_SECRET" (or printf '%s' "$FIREBASE_SECRET") to avoid shell word-splitting/globbing corrupting the Base64 payload. Keeps the decoded JSON intact across environments.

-          echo $FIREBASE_SECRET | base64 --decode > firebase-service-account.json
+          echo "$FIREBASE_SECRET" | base64 --decode > firebase-service-account.json
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Decode Firebase service account
env:
FIREBASE_SECRET: ${{ secrets.FIREBASE_SECRET }}
run: |
echo $FIREBASE_SECRET | base64 --decode > firebase-service-account.json
- name: Decode Firebase service account
env:
FIREBASE_SECRET: ${{ secrets.FIREBASE_SECRET }}
run: |
echo "$FIREBASE_SECRET" | base64 --decode > firebase-service-account.json
🤖 Prompt for AI Agents
.github/workflows/ci-cd.yml around lines 80 to 85: the workflow decodes the
FIREBASE_SECRET using echo $FIREBASE_SECRET which allows shell
word-splitting/globbing to corrupt the Base64 payload; change the command to use
a quoted expansion or printf (e.g., use echo "$FIREBASE_SECRET" or printf '%s'
"$FIREBASE_SECRET") before piping to base64 --decode so the secret is preserved
exactly and the decoded JSON remains valid.

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

- name: Run Fastlane distribute
run: bundle exec fastlane distribute
21 changes: 20 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,23 @@ captures/

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/
.cxx/


# macOS
.DS_Store

# Gradle
.gradle/
build/

# Firebase Service Account
firebase-service-account.json
hsconnect-*.json


# Fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
Binary file removed .gradle/8.13/checksums/checksums.lock
Binary file not shown.
Binary file removed .gradle/8.13/executionHistory/executionHistory.bin
Binary file not shown.
Binary file removed .gradle/8.13/executionHistory/executionHistory.lock
Binary file not shown.
Binary file removed .gradle/8.13/fileChanges/last-build.bin
Binary file not shown.
Binary file removed .gradle/8.13/fileHashes/fileHashes.bin
Binary file not shown.
Binary file removed .gradle/8.13/fileHashes/fileHashes.lock
Binary file not shown.
Binary file removed .gradle/8.13/fileHashes/resourceHashesCache.bin
Binary file not shown.
Empty file removed .gradle/8.13/gc.properties
Empty file.
Binary file removed .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
2 changes: 0 additions & 2 deletions .gradle/buildOutputCleanup/cache.properties

This file was deleted.

Binary file removed .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
2 changes: 0 additions & 2 deletions .gradle/config.properties

This file was deleted.

Binary file removed .gradle/file-system.probe
Binary file not shown.
Empty file removed .gradle/vcs-1/gc.properties
Empty file.
Loading