mirror of
https://github.com/fromchat-messenger/app.git
synced 2026-11-19 04:11:55 +03:00
ci(cache): save only tools/android/build-jar gradle scopes
Packaging scopes' build trees (1.3-2 GB each, 6 scopes) were ~90% installer outputs and jlink runtime duplicates that actions/cache negation patterns are unable to exclude (actions/toolkit#713). Saving ~7 GB per run kept the repo at the 10 GB cache cap and LRU-evicted build-jar/android/windows-rust entries within minutes of being saved. Packaging scopes are now restore-only: they fall back to the build-jar scope via restore-keys, and their outputs regenerate from the JAR artifact in a couple of minutes. Also remove the temporary cache-inspect workflow (purpose served).
This commit is contained in:
@@ -1,221 +0,0 @@
|
||||
# TEMPORARY diagnostic workflow: restore the current caches onto runners using
|
||||
# their EXACT original path lists (actions/cache stamps entries with a version
|
||||
# hash of the path list — restoring to different paths would never match) and
|
||||
# report their on-disk composition (du). Delete once cache trimming is done.
|
||||
name: Cache inspect
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- feature/desktop
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: cache-inspect
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
resolve-keys:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
linux_x64: ${{ steps.k.outputs.linux_x64 }}
|
||||
android: ${{ steps.k.outputs.android }}
|
||||
build_jar: ${{ steps.k.outputs.build_jar }}
|
||||
windows_x64: ${{ steps.k.outputs.windows_x64 }}
|
||||
rust_x64: ${{ steps.k.outputs.rust_x64 }}
|
||||
macos_arm: ${{ steps.k.outputs.macos_arm }}
|
||||
steps:
|
||||
- id: k
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
gh api repos/"$GITHUB_REPOSITORY"/actions/caches?per_page=100 > caches.json
|
||||
python3 - <<'PY' >> "$GITHUB_OUTPUT"
|
||||
import json, re
|
||||
data = json.load(open('caches.json'))
|
||||
pats = {
|
||||
'linux_x64': r'gradle-build-Linux-X64-v2-linux-x64-[0-9a-f]{60}',
|
||||
'android': r'gradle-build-Linux-X64-v2-android-[0-9a-f]{60}',
|
||||
'build_jar': r'gradle-build-Linux-X64-v2-build-jar-[0-9a-f]{60}',
|
||||
'windows_x64': r'gradle-build-Windows-X64-v2-windows-package-x64-[0-9a-f]{60}',
|
||||
'rust_x64': r'windows-rust-Windows-X64-v5-[0-9a-f]{60}',
|
||||
'macos_arm': r'gradle-build-macOS-ARM64-v2-macos-arm64-[0-9a-f]{60}',
|
||||
}
|
||||
for fam, pat in pats.items():
|
||||
sel = next((c for c in data.get('actions_caches', data.get('caches', []))
|
||||
if re.match(pat, c.get('cache_key', c.get('key', '')))), None)
|
||||
k = (sel.get('cache_key') or sel.get('key')) if sel else ''
|
||||
print(fam + '=' + k)
|
||||
PY
|
||||
cat "$GITHUB_OUTPUT"
|
||||
|
||||
linux-x64:
|
||||
needs: resolve-keys
|
||||
if: needs.resolve-keys.outputs.linux_x64 != ''
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/cache/restore@v5
|
||||
with:
|
||||
key: ${{ needs.resolve-keys.outputs.linux_x64 }}
|
||||
path: |
|
||||
.gradle
|
||||
build
|
||||
app/shared/build
|
||||
utils/shared/build
|
||||
app/desktop/build
|
||||
!app/desktop/build/distributions
|
||||
!app/desktop/build/ci
|
||||
!app/desktop/build/compose/binaries
|
||||
!app/desktop/build/compose/tmp
|
||||
- name: du
|
||||
run: |
|
||||
{
|
||||
echo "== top dirs"
|
||||
du -h -d 2 .gradle build app 2>/dev/null | sort -h | tail -35
|
||||
echo "== biggest files"
|
||||
find .gradle build app -type f -exec du -sm {} + 2>/dev/null | sort -rn | head -20
|
||||
} | tee du.txt
|
||||
- uses: actions/upload-artifact@v5
|
||||
with: {name: du-linux-x64, path: du.txt, retention-days: 3}
|
||||
|
||||
android:
|
||||
needs: resolve-keys
|
||||
if: needs.resolve-keys.outputs.android != ''
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/cache/restore@v5
|
||||
with:
|
||||
key: ${{ needs.resolve-keys.outputs.android }}
|
||||
path: |
|
||||
.gradle
|
||||
build
|
||||
app/shared/build
|
||||
app/android/build
|
||||
utils/shared/build
|
||||
utils/android/build
|
||||
!app/android/build/outputs
|
||||
- name: du
|
||||
run: |
|
||||
{
|
||||
echo "== top dirs"
|
||||
du -h -d 2 .gradle build app utils 2>/dev/null | sort -h | tail -30
|
||||
echo "== biggest files"
|
||||
find .gradle build app utils -type f -exec du -sm {} + 2>/dev/null | sort -rn | head -20
|
||||
} | tee du.txt
|
||||
- uses: actions/upload-artifact@v5
|
||||
with: {name: du-android, path: du.txt, retention-days: 3}
|
||||
|
||||
build-jar:
|
||||
needs: resolve-keys
|
||||
if: needs.resolve-keys.outputs.build_jar != ''
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/cache/restore@v5
|
||||
with:
|
||||
key: ${{ needs.resolve-keys.outputs.build_jar }}
|
||||
path: |
|
||||
.gradle
|
||||
build
|
||||
app/shared/build
|
||||
utils/shared/build
|
||||
app/desktop/build
|
||||
!app/desktop/build/distributions
|
||||
!app/desktop/build/ci
|
||||
!app/desktop/build/compose/binaries
|
||||
- name: du
|
||||
run: |
|
||||
{
|
||||
echo "== top dirs"
|
||||
du -h -d 2 .gradle build app 2>/dev/null | sort -h | tail -35
|
||||
echo "== biggest files"
|
||||
find .gradle build app -type f -exec du -sm {} + 2>/dev/null | sort -rn | head -20
|
||||
} | tee du.txt
|
||||
- uses: actions/upload-artifact@v5
|
||||
with: {name: du-build-jar, path: du.txt, retention-days: 3}
|
||||
|
||||
windows-package-x64:
|
||||
needs: resolve-keys
|
||||
if: needs.resolve-keys.outputs.windows_x64 != ''
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/cache/restore@v5
|
||||
with:
|
||||
key: ${{ needs.resolve-keys.outputs.windows_x64 }}
|
||||
path: |
|
||||
.gradle
|
||||
build
|
||||
app/shared/build
|
||||
utils/shared/build
|
||||
app/desktop/build
|
||||
!app/desktop/build/distributions
|
||||
!app/desktop/build/ci
|
||||
!app/desktop/build/compose/binaries
|
||||
!app/desktop/build/compose/tmp
|
||||
- name: du
|
||||
shell: bash
|
||||
run: |
|
||||
{
|
||||
echo "== top dirs"
|
||||
du -h -d 2 .gradle build app 2>/dev/null | sort -h | tail -35
|
||||
echo "== biggest files"
|
||||
find .gradle build app -type f -exec du -sm {} + 2>/dev/null | sort -rn | head -20
|
||||
} | tee du.txt
|
||||
- uses: actions/upload-artifact@v5
|
||||
with: {name: du-windows-package-x64, path: du.txt, retention-days: 3}
|
||||
|
||||
rust-x64:
|
||||
needs: resolve-keys
|
||||
if: needs.resolve-keys.outputs.rust_x64 != ''
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/cache/restore@v5
|
||||
with:
|
||||
key: ${{ needs.resolve-keys.outputs.rust_x64 }}
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
app/desktop/windows-setup/target
|
||||
- name: du
|
||||
shell: bash
|
||||
run: |
|
||||
{
|
||||
echo "== top dirs"
|
||||
du -h -d 2 ~/.cargo app/desktop/windows-setup/target 2>/dev/null | sort -h | tail -30
|
||||
echo "== biggest files"
|
||||
find ~/.cargo app/desktop/windows-setup/target -type f -exec du -sm {} + 2>/dev/null | sort -rn | head -20
|
||||
} | tee du.txt
|
||||
- uses: actions/upload-artifact@v5
|
||||
with: {name: du-rust-x64, path: du.txt, retention-days: 3}
|
||||
|
||||
macos-arm64:
|
||||
needs: resolve-keys
|
||||
if: needs.resolve-keys.outputs.macos_arm != ''
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/cache/restore@v5
|
||||
with:
|
||||
key: ${{ needs.resolve-keys.outputs.macos_arm }}
|
||||
path: |
|
||||
.gradle
|
||||
build
|
||||
app/shared/build
|
||||
utils/shared/build
|
||||
app/desktop/build
|
||||
!app/desktop/build/distributions
|
||||
!app/desktop/build/ci
|
||||
!app/desktop/build/compose/binaries
|
||||
!app/desktop/build/compose/tmp
|
||||
- name: du
|
||||
run: |
|
||||
{
|
||||
echo "== top dirs"
|
||||
du -h -d 2 .gradle build app 2>/dev/null | sort -h | tail -35
|
||||
echo "== biggest files"
|
||||
find .gradle build app -type f -exec du -sm {} + 2>/dev/null | sort -rn | head -20
|
||||
} | tee du.txt
|
||||
- uses: actions/upload-artifact@v5
|
||||
with: {name: du-macos-arm64, path: du.txt, retention-days: 3}
|
||||
Reference in New Issue
Block a user