Create android.yml
This commit is contained in:
@@ -0,0 +1,50 @@
|
|||||||
|
name: Android CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["main"]
|
||||||
|
pull_request:
|
||||||
|
branches: ["main"]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build and Test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# Step 1: Check out the repository code
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# Step 2: Set up JDK 17 with Gradle Caching
|
||||||
|
- name: Set up JDK 17
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: "zulu"
|
||||||
|
java-version: "17"
|
||||||
|
cache: "gradle"
|
||||||
|
|
||||||
|
# Step 3: Grant execute permission to Gradle Wrapper
|
||||||
|
- name: Grant Execute Permission for Gradlew
|
||||||
|
run: cd BalanceAndroid && chmod +x ./gradlew
|
||||||
|
|
||||||
|
# Step 4: Jetpack Compose Compiler & Lint Check
|
||||||
|
# Verifies Compose layout rules and Kotlin formatting
|
||||||
|
- name: Run Lint and Code Quality
|
||||||
|
run: cd BalanceAndroid && ./gradlew lintDebug
|
||||||
|
|
||||||
|
# Step 5: Run Unit Tests & Verify Room Schema
|
||||||
|
# Runs localized Room migrations and DAO tests that do not require an emulator
|
||||||
|
- name: Run Unit Tests
|
||||||
|
run: cd BalanceAndroid && ./gradlew testDebugUnitTest
|
||||||
|
|
||||||
|
# Step 6: Assemble Debug APK (Targeting Android 8.0 / API 26+)
|
||||||
|
- name: Build Debug APK
|
||||||
|
run: cd BalanceAndroid && ./gradlew assembleDebug
|
||||||
|
|
||||||
|
# Step 7: Upload the generated APK
|
||||||
|
- name: Upload Debug APK
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: android-compose-room-debug-apk
|
||||||
|
path: BalanceAndroid/app/build/outputs/apk/debug/app-debug.apk
|
||||||
Reference in New Issue
Block a user