mirror of
https://github.com/D-Modem/app.git
synced 2026-11-28 17:38:05 -08:00
Merge pull request #106 from D-Modem/claude/project-thread-uuavwv
CI: no separate cache entry for Robolectric's jars
This commit is contained in:
1 file changed
+3
-40
@@ -14,9 +14,9 @@
|
||||
# Packages: apt's downloads are cached (.github/actions/apt), keyed on
|
||||
# the runner image and the package list. The Android SDK packages that
|
||||
# the image does not have (CMake, the emulator's system image) are cached
|
||||
# the same way (.github/actions/android-sdk). Robolectric's jars have
|
||||
# their own cache entry, keyed on their versions (app/build.gradle.kts).
|
||||
# Gradle downloads from Google's mirror of Maven Central first
|
||||
# the same way (.github/actions/android-sdk). Gradle's downloads
|
||||
# (Robolectric's jars too, app/build.gradle.kts) are in setup-gradle's
|
||||
# cache. Gradle downloads from Google's mirror of Maven Central first
|
||||
# (MAVEN_CENTRAL_MIRROR), because Maven Central's rate limit refuses
|
||||
# downloads from the runners.
|
||||
#
|
||||
@@ -87,22 +87,6 @@ jobs:
|
||||
|
||||
- uses: gradle/actions/setup-gradle@v5
|
||||
|
||||
# Robolectric's Android framework jars (about 200 MB each, app/build.gradle.kts), in Gradle's
|
||||
# cache: their own cache entry, keyed on their versions, so a run does not download them
|
||||
# from Maven Central (its rate limit, HTTP 429)
|
||||
# (the key: Robolectric's version and its jars' versions, then the files the entry holds;
|
||||
# a run that downloads more files saves a new entry)
|
||||
- name: Robolectric's jars, key
|
||||
id: robolectric
|
||||
run: |
|
||||
echo "prefix=robolectric-$({ grep -h '^robolectric' gradle/libs.versions.toml; grep -h 'android-all-instrumented:' app/build.gradle.kts; } | sort | sha256sum | cut -c1-16)-" >> "$GITHUB_OUTPUT"
|
||||
- id: robolectric-restore
|
||||
uses: actions/cache/restore@v5
|
||||
with:
|
||||
path: ~/.gradle/caches/modules-2/files-2.1/org.robolectric
|
||||
key: ${{ steps.robolectric.outputs.prefix }}
|
||||
restore-keys: ${{ steps.robolectric.outputs.prefix }}
|
||||
|
||||
- name: SDK packages
|
||||
uses: ./.github/actions/android-sdk
|
||||
with:
|
||||
@@ -133,27 +117,6 @@ jobs:
|
||||
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
|
||||
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
||||
|
||||
# (saved also when a test fails: the jars that Gradle downloaded are good)
|
||||
- name: Robolectric's jars, downloaded
|
||||
id: robolectric-got
|
||||
if: ${{ !cancelled() }}
|
||||
env:
|
||||
PREFIX: ${{ steps.robolectric.outputs.prefix }}
|
||||
RESTORED: ${{ steps.robolectric-restore.outputs.cache-matched-key }}
|
||||
run: |
|
||||
d=~/.gradle/caches/modules-2/files-2.1/org.robolectric
|
||||
[ -d "$d" ] || exit 0
|
||||
key="$PREFIX$(cd "$d" && find . -type f | sort | sha256sum | cut -c1-16)"
|
||||
if [ "$key" != "$RESTORED" ]; then
|
||||
echo "key=$key" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
- if: ${{ !cancelled() && steps.robolectric-got.outputs.key != '' }}
|
||||
uses: actions/cache/save@v5
|
||||
continue-on-error: true
|
||||
with:
|
||||
path: ~/.gradle/caches/modules-2/files-2.1/org.robolectric
|
||||
key: ${{ steps.robolectric-got.outputs.key }}
|
||||
|
||||
- name: The APK's signer
|
||||
if: ${{ !cancelled() && hashFiles('app/build/outputs/apk/debug/app-debug.apk') != '' }}
|
||||
run: |
|
||||
|
||||
Reference in new issue
Block a user