Skip to content

Commit ed1413b

Browse files
keithwillcodedevin-ai-integration[bot]
authored andcommitted
ci: optimize sparse-checkout and cache to reduce cache size (calcom#26692)
* ci: optimize sparse-checkout to reduce cache size by ~230MB Exclude additional large files from CI checkout that are not needed for builds/tests: - docs/images/ (~90MB) - Documentation images - packages/app-store/*/static/*.png,jpg,jpeg,gif (~140MB) - App store screenshots These files are only needed for documentation rendering and app store UI display, not for CI builds, linting, type checking, or tests. SVG icons in app-store are preserved as they may be needed for the build. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * ci: exclude generated app-store static files from cache The apps/web/public/app-store directory contains ~151MB of static files copied from packages/app-store/*/static/ during build. These files are regenerated during yarn install and don't need to be cached. Combined with the sparse-checkout exclusions, this should significantly reduce the git checkout cache size. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * ci: fix sparse-checkout by limiting first checkout to .github only The first checkout in the prepare job was doing a full checkout (~535 MB), and then dangerous-git-checkout applied sparse-checkout. But the files from the first checkout remained on disk because sparse-checkout doesn't remove files that were already checked out. By limiting the first checkout to only .github (which is needed to access the local actions), we avoid downloading the full repo twice. The actual sparse-checkout with exclusions is then applied by dangerous-git-checkout. This should reduce the cache from ~504 MB to ~148 MB. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: update cache-checkout to include sparse-checkout exclusions and fix pr.yml compatibility Co-Authored-By: unknown <> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent e4a7bc5 commit ed1413b

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

.github/actions/cache-checkout/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ runs:
1212
!.git
1313
!node_modules
1414
!**/node_modules
15+
!apps/web/public/app-store
1516
key: git-checkout-${{ github.head_ref || github.ref_name }}-${{ github.event.pull_request.head.sha || github.sha }}
1617
- name: Checkout PR code (on cache miss)
1718
if: steps.cache-checkout.outputs.cache-hit != 'true'
@@ -24,3 +25,8 @@ runs:
2425
/*
2526
!/example-apps/
2627
!**/*.mp4
28+
!/docs/images/
29+
!packages/app-store/*/static/*.png
30+
!packages/app-store/*/static/*.jpg
31+
!packages/app-store/*/static/*.jpeg
32+
!packages/app-store/*/static/*.gif

.github/actions/dangerous-git-checkout/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ runs:
1313
/*
1414
!/example-apps/
1515
!**/*.mp4
16+
!/docs/images/
17+
!packages/app-store/*/static/*.png
18+
!packages/app-store/*/static/*.jpg
19+
!packages/app-store/*/static/*.jpeg
20+
!packages/app-store/*/static/*.gif

.github/workflows/pr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ jobs:
174174
db-cache-hit: ${{ steps.cache-db-check.outputs.cache-hit }}
175175
steps:
176176
- uses: actions/checkout@v4
177+
with:
178+
sparse-checkout: .github
177179
- uses: ./.github/actions/cache-checkout
178180
- name: Generate DB cache key
179181
id: cache-db-key

0 commit comments

Comments
 (0)