038beb59df
- Build and test on push/PR to main - Run unit tests - Build debug APK - Run Android lint (non-blocking) - Upload artifacts (APK + lint reports) Note: Requires gradle wrapper to be generated with 'gradle wrapper'
65 lines
1.4 KiB
YAML
65 lines
1.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '17'
|
|
distribution: 'temurin'
|
|
cache: gradle
|
|
|
|
- name: Grant execute permission for gradlew
|
|
run: chmod +x gradlew
|
|
|
|
- name: Run unit tests
|
|
run: ./gradlew test --stacktrace
|
|
|
|
- name: Build debug APK
|
|
run: ./gradlew assembleDebug --stacktrace
|
|
|
|
- name: Upload APK artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: app-debug
|
|
path: app/build/outputs/apk/debug/app-debug.apk
|
|
retention-days: 7
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '17'
|
|
distribution: 'temurin'
|
|
cache: gradle
|
|
|
|
- name: Grant execute permission for gradlew
|
|
run: chmod +x gradlew
|
|
|
|
- name: Run Android Lint
|
|
run: ./gradlew lint --stacktrace
|
|
continue-on-error: true
|
|
|
|
- name: Upload lint results
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: lint-results
|
|
path: app/build/reports/lint-results*.html
|
|
retention-days: 7
|