chore: restore large files before ci coverage checks

A CI checkout omits every file over 50 MB, so verify and generate_pack
resolve those database entries against a disk that does not hold them and
report them missing. The generated README then stops matching the
committed one for a reason that has nothing to do with staleness.

restore_large_files.py writes them back from the release cache, matched by
SHA1 rather than by name, and only where the path is gitignored and
absent. The site workflow runs it, and refreshes the data directories, before
generating.
This commit is contained in:
Abdessamad Derraz committed 2026-08-10 14:34:27 +02:00
1 parent b76edd2034
commit d588ebbde4
4 files changed
+182 -26

No files matched your search

+1 -26
View File
@@ -58,32 +58,7 @@ jobs:
run: |
mkdir -p .cache/large
gh release download large-files -D .cache/large/ 2>/dev/null || true
python3 -c "
import hashlib, json, os, shutil
db = json.load(open('database.json'))
with open('.gitignore') as f:
ignored = {l.strip() for l in f if l.strip().startswith('bios/')}
cache = '.cache/large'
if not os.path.isdir(cache):
exit(0)
idx = {}
for fn in os.listdir(cache):
fp = os.path.join(cache, fn)
if os.path.isfile(fp):
h = hashlib.sha1(open(fp, 'rb').read()).hexdigest()
idx[h] = fp
restored = 0
for sha1, entry in db['files'].items():
path = entry['path']
if path in ignored and not os.path.exists(path):
src = idx.get(sha1)
if src:
os.makedirs(os.path.dirname(path), exist_ok=True)
shutil.copy2(src, path)
print(f'Restored: {path}')
restored += 1
print(f'Total: {restored} files restored')
"
python scripts/restore_large_files.py
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}