ci: Run git gc before creating Git cache tarball

Since the job which creates the cache tarball starts from the previous
cache, the cache kept accumulating cruft and growing bigger.

This cuts the size of the tarball in half (from almost 600M to under
300M), which can translate to significant time savings when downloading
it on some runners.

v2:
* Use git gc --aggressive (Eric Anholt)

Reviewed-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7920>
This commit is contained in:
Michel Dänzer 2020-12-04 14:55:54 +01:00 committed by Marge Bot
parent bb46a010bb
commit a82fd89060
1 changed files with 2 additions and 0 deletions

View File

@ -479,6 +479,8 @@ make git archive:
tags:
- packet.net
script:
# Compactify the .git directory
- git gc --aggressive
# compress the current folder
- tar -cvzf ../$CI_PROJECT_NAME.tar.gz .