diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 00000000..c79ff329 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,43 @@ +name: Android CI/CD + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + name: Build & Test Android App + runs-on: ubuntu-latest + + steps: + - name: Checkout Source Code + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + cache: 'gradle' + + - name: Grant Execute Permission for Gradlew + run: chmod +x gradlew + + - name: Run Code Style Check (ktlint) + run: ./gradlew ktlintCheck + + - name: Run Unit & Integration Tests + run: ./gradlew test + + - name: Build Debug APK + run: ./gradlew assembleDebug + + - name: Upload Debug APK Artifact + uses: actions/upload-artifact@v4 + with: + name: hermescontrol-debug-apk + path: app/build/outputs/apk/debug/app-debug.apk + if-no-files-found: error + retention-days: 7