Fix in-app PDF picker permission error and zoom page splitting #53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test Suite | |
| on: | |
| push: | |
| branches: [ master, main ] | |
| pull_request: | |
| branches: [ master, main ] | |
| jobs: | |
| static-analysis: | |
| name: Static Analysis | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Run static analysis | |
| run: | | |
| chmod +x scripts/static_analysis.sh | |
| bash scripts/static_analysis.sh | |
| - name: Run Android Lint | |
| run: ./gradlew lintFdroidDebug --continue | |
| - name: Upload lint report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lint-report | |
| path: app/build/reports/lint-results-*.html | |
| # Unit tests disabled - pre-existing Robolectric configuration issue | |
| # TODO: Fix Robolectric test runner before re-enabling | |
| # unit-tests: | |
| # name: Unit Tests | |
| # runs-on: ubuntu-latest | |
| # needs: static-analysis | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # | |
| # - name: Set up JDK 17 | |
| # uses: actions/setup-java@v4 | |
| # with: | |
| # java-version: '17' | |
| # distribution: 'temurin' | |
| # | |
| # - name: Cache Gradle | |
| # uses: actions/cache@v4 | |
| # with: | |
| # path: | | |
| # ~/.gradle/caches | |
| # ~/.gradle/wrapper | |
| # key: gradle-${{ hashFiles('**/*.gradle.kts') }} | |
| # | |
| # - name: Run unit tests | |
| # run: ./gradlew testFdroidDebugUnitTest | |
| # | |
| # - name: Upload test results | |
| # if: always() | |
| # uses: actions/upload-artifact@v4 | |
| # with: | |
| # name: unit-test-results | |
| # path: app/build/reports/tests/ | |
| build-check: | |
| name: Build Verification | |
| runs-on: ubuntu-latest | |
| needs: static-analysis | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: gradle-${{ hashFiles('**/*.gradle.kts') }} | |
| - name: Build fdroid debug | |
| run: ./gradlew :app:assembleFdroidDebug | |
| - name: Build playstore debug | |
| run: ./gradlew :app:assemblePlaystoreDebug | |
| crash-free-check: | |
| name: Crash Pattern Check | |
| runs-on: ubuntu-latest | |
| needs: static-analysis | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check for known crash patterns | |
| run: | | |
| echo "Checking BaseCanvas crash patterns..." | |
| # Fail if any Canvas construction lacks recycle guard | |
| if grep -rn "Canvas(bitmap)" app/src/main --include="*.kt" | \ | |
| grep -v "isRecycled\|//"; then | |
| echo "ERROR: Unguarded Canvas construction found" | |
| exit 1 | |
| fi | |
| echo "Checking OOM patterns in heavy operations..." | |
| if grep -rn "Bitmap.createBitmap" app/src/main --include="*.kt" | \ | |
| grep -l "for\|forEach\|map" | \ | |
| xargs grep -L "OutOfMemoryError" 2>/dev/null; then | |
| echo "WARNING: Bitmap creation in loop without OOM catch" | |
| fi | |
| echo "Crash pattern check complete" | |
| playstore-release-check: | |
| name: PlayStore Release Build Check | |
| runs-on: ubuntu-latest | |
| needs: build-check | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: gradle-${{ hashFiles('**/*.gradle.kts') }} | |
| - name: Build PlayStore Release (unsigned) | |
| run: | | |
| # Build without signing to verify ProGuard doesn't break anything | |
| ./gradlew :app:assemblePlaystoreRelease --continue \ | |
| -PAPP_VERSION_CODE=99999 \ | |
| -PAPP_VERSION_NAME="9.9.9-test" | |
| continue-on-error: true | |
| - name: Verify APK Output | |
| run: | | |
| echo "Checking for APK output..." | |
| ls -lh app/build/outputs/apk/playstore/release/ || echo "No APKs found" | |
| - name: Upload PlayStore Release APK | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playstore-release-test-apk | |
| path: app/build/outputs/apk/playstore/release/*.apk | |
| retention-days: 5 | |
| # Instrumented tests - disabled by default as they require emulator | |
| # Uncomment when ready to run on CI | |
| # instrumented-tests: | |
| # name: UI Instrumented Tests | |
| # runs-on: ubuntu-latest | |
| # needs: unit-tests | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # | |
| # - name: Set up JDK 17 | |
| # uses: actions/setup-java@v4 | |
| # with: | |
| # java-version: '17' | |
| # distribution: 'temurin' | |
| # | |
| # - name: Enable KVM | |
| # run: | | |
| # echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
| # sudo udevadm control --reload-rules | |
| # sudo udevadm trigger --name-match=kvm | |
| # | |
| # - name: AVD cache | |
| # uses: actions/cache@v4 | |
| # id: avd-cache | |
| # with: | |
| # path: | | |
| # ~/.android/avd/* | |
| # ~/.android/adb* | |
| # key: avd-api-34 | |
| # | |
| # - name: Create AVD and run tests | |
| # uses: reactivecircus/android-emulator-runner@v2 | |
| # with: | |
| # api-level: 34 | |
| # arch: x86_64 | |
| # profile: Nexus 6 | |
| # ram-size: 4096M | |
| # heap-size: 512M | |
| # script: ./gradlew connectedFdroidDebugAndroidTest | |
| # | |
| # - name: Upload instrumented test results | |
| # if: always() | |
| # uses: actions/upload-artifact@v4 | |
| # with: | |
| # name: instrumented-test-results | |
| # path: app/build/reports/androidTests/ |