diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index b40ffc3..001d42d 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -122,12 +122,24 @@ jobs: # libmpv and its dependency tree are the slowest part of the build, and # depend only on the pinned revision and the build script, which stamps - # its output with both and skips the build when the stamp matches. - - uses: actions/cache@v6 + # its output with both and skips the build when the stamp matches. Built + # and saved in steps of its own, so a later failure in Gradle does not + # discard it the way a post-job cache save would. + - id: libmpv + uses: actions/cache/restore@v6 with: path: android/app/build/generated/mpv key: libmpv-${{ hashFiles('scripts/build-libmpv-android.sh') }} + - name: Build libmpv + run: bash scripts/build-libmpv-android.sh + + - if: steps.libmpv.outputs.cache-hit != 'true' + uses: actions/cache/save@v6 + with: + path: android/app/build/generated/mpv + key: ${{ steps.libmpv.outputs.cache-primary-key }} + - uses: gradle/actions/setup-gradle@v4 with: gradle-version: '8.13' @@ -212,12 +224,24 @@ jobs: # libmpv and its dependency tree are the slowest part of the build, and # depend only on the pinned revision and the build script, which stamps - # its output with both and skips the build when the stamp matches. - - uses: actions/cache@v6 + # its output with both and skips the build when the stamp matches. Built + # and saved in steps of its own, so a later failure in Gradle does not + # discard it the way a post-job cache save would. + - id: libmpv + uses: actions/cache/restore@v6 with: path: android/app/build/generated/mpv key: libmpv-${{ hashFiles('scripts/build-libmpv-android.sh') }} + - name: Build libmpv + run: bash scripts/build-libmpv-android.sh + + - if: steps.libmpv.outputs.cache-hit != 'true' + uses: actions/cache/save@v6 + with: + path: android/app/build/generated/mpv + key: ${{ steps.libmpv.outputs.cache-primary-key }} + - uses: gradle/actions/setup-gradle@v4 with: gradle-version: '8.13' diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 753ee81..6c12005 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -142,6 +142,9 @@ android { "GradleDependency", "NewerVersionAvailable", "AndroidGradlePluginVersion", + // The same for the platform: raising targetSdk opts into new + // behaviour and needs its own pass on a device. + "OldTargetApi", ) sarifReport = true }