From bd9a180b2076de26033023d35e7c30e209e184cb Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Fri, 31 Jul 2026 14:09:48 +0700 Subject: [PATCH] Create android.yml --- .github/workflows/android.yml | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/android.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..a2ba13d --- /dev/null +++ b/.github/workflows/android.yml @@ -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