61 lines
1.4 KiB
YAML
61 lines
1.4 KiB
YAML
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'
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v4
|
|
|
|
- name: Grant Execute Permission for Gradlew
|
|
run: chmod +x gradlew
|
|
|
|
- name: Run Code Style Check (ktlint)
|
|
run: ./gradlew ktlintCheck
|
|
|
|
- name: Run Android Lint (Static Analysis)
|
|
run: ./gradlew lintDebug
|
|
|
|
- name: Run Unit & Integration Tests
|
|
run: ./gradlew test
|
|
|
|
- name: Build Debug APK
|
|
run: ./gradlew assembleDebug
|
|
|
|
- name: Upload Test & Lint Reports
|
|
uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: verification-reports
|
|
path: |
|
|
app/build/reports/tests/
|
|
app/build/reports/lint-results-debug.html
|
|
app/build/reports/ktlint/
|
|
retention-days: 7
|
|
|
|
- name: Upload Debug APK Artifact
|
|
uses: actions/upload-artifact@v4
|
|
if: success()
|
|
with:
|
|
name: hermescontrol-debug-apk
|
|
path: app/build/outputs/apk/debug/app-debug.apk
|
|
if-no-files-found: error
|
|
retention-days: 7
|