R568: harden custom accent preference schema and migration safety #19
Workflow file for this run
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: Theme instrumentation gate | ||
|
Check failure on line 1 in .github/workflows/theme_instrumentation_pr.yml
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'app/src/main/java/eu/kanade/domain/ui/**' | ||
| - 'app/src/main/java/eu/kanade/domain/ui/model/**' | ||
| - 'app/src/main/java/eu/kanade/presentation/theme/**' | ||
| - 'app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAppearanceScreen.kt' | ||
| - 'app/src/main/java/eu/kanade/presentation/more/settings/widget/AppThemePreferenceWidget.kt' | ||
| - 'app/src/main/java/eu/kanade/presentation/more/onboarding/ThemeStep.kt' | ||
| - 'app/src/androidTest/**' | ||
| - '.github/workflows/theme_instrumentation_pr.yml' | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: true | ||
| permissions: | ||
| contents: read | ||
| env: | ||
| SQLDELIGHT_AGP9_FIX_SHA: c8f6011c014368544c71f5e490ef0409bb2f4705 | ||
| SQM2_PATH: ${{ env.HOME }}/.m2/repository/app/cash | ||
| jobs: | ||
| prepare_sqldelight: | ||
| name: Prepare SqlDelight artifacts | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Restore SqlDelight local Maven cache | ||
| id: sqldelight-cache | ||
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.2.3 | ||
| with: | ||
| path: ${{ env.SQM2_PATH }} | ||
| key: sqldelight-m2-${{ env.SQLDELIGHT_AGP9_FIX_SHA }} | ||
| - name: Set up JDK | ||
| uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 | ||
| with: | ||
| java-version: 17 | ||
| distribution: temurin | ||
| - name: Build SqlDelight AGP 9 fix | ||
| if: steps.sqldelight-cache.outputs.cache-hit != 'true' | ||
| run: | | ||
| set -euxo pipefail | ||
| git clone --filter=blob:none https://github.com/cashapp/sqldelight.git /tmp/sqldelight | ||
| cd /tmp/sqldelight | ||
| git checkout --detach "$SQLDELIGHT_AGP9_FIX_SHA" | ||
| ./gradlew publishToMavenLocal -x test --no-daemon | ||
| - name: Upload SqlDelight local Maven artifacts | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||
| with: | ||
| name: sqldelight-m2-${{ env.SQLDELIGHT_AGP9_FIX_SHA }} | ||
| path: ${{ env.SQM2_PATH }} | ||
| theme_android_test: | ||
| name: Theme instrumentation tests | ||
| runs-on: ubuntu-24.04 | ||
| needs: prepare_sqldelight | ||
| steps: | ||
| - name: Clone repo | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| - name: Set up JDK | ||
| uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 | ||
| with: | ||
| java-version: 17 | ||
| distribution: temurin | ||
| - name: Set up gradle | ||
| uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0 | ||
| with: | ||
| cache-read-only: false | ||
| - name: Download SqlDelight local Maven artifacts | ||
| uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
| with: | ||
| name: sqldelight-m2-${{ env.SQLDELIGHT_AGP9_FIX_SHA }} | ||
| path: ${{ env.SQM2_PATH }} | ||
| - name: Build instrumentation APKs | ||
| run: ./gradlew :app:assembleDebug :app:assembleDebugAndroidTest --build-cache | ||
| - name: Run theming instrumentation tests | ||
| uses: reactivecircus/android-emulator-runner@v2 | ||
| with: | ||
| api-level: 35 | ||
| arch: x86_64 | ||
| target: google_apis | ||
| profile: pixel_7 | ||
| script: | | ||
| set +e | ||
| ./gradlew :app:connectedDebugAndroidTest \ | ||
| -Pandroid.testInstrumentationRunnerArguments.class=eu.kanade.presentation.theme.ThemePreferencesInstrumentationTest,eu.kanade.presentation.more.settings.widget.ThemeAppearanceFlowAndroidTest \ | ||
| --build-cache | ||
| status=$? | ||
| adb logcat -d > app/build/reports/androidTests/theme-logcat.txt || true | ||
| exit $status | ||
| - name: Upload instrumentation reports | ||
| if: always() | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||
| with: | ||
| name: theme-instrumentation-reports-${{ github.sha }} | ||
| path: | | ||
| app/build/reports/androidTests | ||
| app/build/outputs/androidTest-results | ||
| app/build/reports/androidTests/theme-logcat.txt | ||
| if-no-files-found: warn | ||