Scheduling infrastructure for absolutely everyone.
fix: refactor cache-checkout to use actions/cache@v4 with fallback (#26702)
Keith Williamsbf4cdf624565
diff --git a/.github/actions/cache-checkout/action.yml b/.github/actions/cache-checkout/action.ymlindex d7bbf1fe515..2f6779e1bb0 100644--- a/.github/actions/cache-checkout/action.yml+++ b/.github/actions/cache-checkout/action.yml@@ -1,17 +1,11 @@name: Cache Git Checkout-description: "Save or restore git checkout from cache to speed up CI workflows"-inputs:- mode:- description: "Mode of operation: 'save' to cache the checkout, 'restore' to restore from cache"- required: true-+description: "Cache or restore git checkout to speed up CI workflows"runs:using: "composite"steps:- - name: Restore git checkout from cache- if: ${{ inputs.mode == 'restore' }}- uses: actions/cache/restore@v4- id: cache-restore+ - name: Cache git checkout+ uses: actions/cache@v4+ id: cache-checkoutwith:path: |.@@ -19,15 +13,14 @@ runs:!node_modules!**/node_moduleskey: git-checkout-${{ github.head_ref || github.ref_name }}-${{ github.event.pull_request.head.sha || github.sha }}- fail-on-cache-miss: true-- - name: Save git checkout to cache- if: ${{ inputs.mode == 'save' }}- uses: actions/cache/save@v4+ - name: Checkout PR code (on cache miss)+ if: steps.cache-checkout.outputs.cache-hit != 'true'+ uses: actions/checkout@v4with:- path: |- .- !.git- !node_modules- !**/node_modules- key: git-checkout-${{ github.head_ref || github.ref_name }}-${{ github.event.pull_request.head.sha || github.sha }}+ ref: ${{ github.event.pull_request.head.sha }}+ fetch-depth: 2+ sparse-checkout-cone-mode: false+ sparse-checkout: |+ /*+ !/example-apps/+ !**/*.mp4diff --git a/.github/workflows/api-v1-production-build.yml b/.github/workflows/api-v1-production-build.ymlindex 380340d37d1..02e534ce24f 100644--- a/.github/workflows/api-v1-production-build.yml+++ b/.github/workflows/api-v1-production-build.yml@@ -68,8 +68,6 @@ jobs:with:sparse-checkout: .github- uses: ./.github/actions/cache-checkout- with:- mode: restore- uses: ./.github/actions/yarn-install- uses: ./.github/actions/cache-db- name: Cache API v1 production builddiff --git a/.github/workflows/api-v2-production-build.yml b/.github/workflows/api-v2-production-build.ymlindex 2d2e9cb4721..fe25f6604d5 100644--- a/.github/workflows/api-v2-production-build.yml+++ b/.github/workflows/api-v2-production-build.yml@@ -38,8 +38,6 @@ jobs:with:sparse-checkout: .github- uses: ./.github/actions/cache-checkout- with:- mode: restore- uses: ./.github/actions/yarn-install- name: Generate Prisma schemasworking-directory: apps/api/v2diff --git a/.github/workflows/api-v2-unit-tests.yml b/.github/workflows/api-v2-unit-tests.ymlindex bc33f8b4a85..8eb08509caf 100644--- a/.github/workflows/api-v2-unit-tests.yml+++ b/.github/workflows/api-v2-unit-tests.yml@@ -15,8 +15,6 @@ jobs:with:sparse-checkout: .github- uses: ./.github/actions/cache-checkout- with:- mode: restore- uses: ./.github/actions/yarn-install- run: yarn prisma generate- name: Run API v2 unit testsdiff --git a/.github/workflows/atoms-production-build.yml b/.github/workflows/atoms-production-build.ymlindex ef6f9a42105..3552cb5a755 100644--- a/.github/workflows/atoms-production-build.yml+++ b/.github/workflows/atoms-production-build.yml@@ -15,8 +15,6 @@ jobs:with:sparse-checkout: .github- uses: ./.github/actions/cache-checkout- with:- mode: restore- uses: ./.github/actions/yarn-install- name: Cache atoms production builduses: actions/cache@v4diff --git a/.github/workflows/check-api-v2-breaking-changes.yml b/.github/workflows/check-api-v2-breaking-changes.ymlindex 270f0bd08cc..102d837f9c6 100644--- a/.github/workflows/check-api-v2-breaking-changes.yml+++ b/.github/workflows/check-api-v2-breaking-changes.yml@@ -37,8 +37,6 @@ jobs:with:sparse-checkout: .github- uses: ./.github/actions/cache-checkout- with:- mode: restore- uses: ./.github/actions/yarn-install- name: Generate Swaggerdiff --git a/.github/workflows/check-types.yml b/.github/workflows/check-types.ymlindex bd2da476723..dfccf1abaff 100644--- a/.github/workflows/check-types.yml+++ b/.github/workflows/check-types.yml@@ -15,8 +15,6 @@ jobs:with:sparse-checkout: .github- uses: ./.github/actions/cache-checkout- with:- mode: restore- uses: ./.github/actions/yarn-install- name: Show inforun: node -e "console.log(require('v8').getHeapStatistics())"diff --git a/.github/workflows/companion-build.yml b/.github/workflows/companion-build.ymlindex 58cd1be35d9..c0f10dc3285 100644--- a/.github/workflows/companion-build.yml+++ b/.github/workflows/companion-build.yml@@ -20,8 +20,6 @@ jobs:with:sparse-checkout: .github- uses: ./.github/actions/cache-checkout- with:- mode: restore- name: Setup Bunuses: oven-sh/setup-bun@v1diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.ymlindex 6e869ff753b..3b573b7a8a5 100644--- a/.github/workflows/docs-build.yml+++ b/.github/workflows/docs-build.yml@@ -15,8 +15,6 @@ jobs:with:sparse-checkout: .github- uses: ./.github/actions/cache-checkout- with:- mode: restore- name: Cache Docs builduses: actions/cache@v4id: cache-docs-builddiff --git a/.github/workflows/e2e-api-v2.yml b/.github/workflows/e2e-api-v2.ymlindex 9656c4b4737..5c05003be70 100644--- a/.github/workflows/e2e-api-v2.yml+++ b/.github/workflows/e2e-api-v2.yml@@ -77,8 +77,6 @@ jobs:with:sparse-checkout: .github- uses: ./.github/actions/cache-checkout- with:- mode: restore- uses: ./.github/actions/yarn-install- uses: ./.github/actions/cache-db- name: Build platform packages with Turbodiff --git a/.github/workflows/e2e-app-store.yml b/.github/workflows/e2e-app-store.ymlindex d7bede4762d..a89e2e9124c 100644--- a/.github/workflows/e2e-app-store.yml+++ b/.github/workflows/e2e-app-store.yml@@ -84,8 +84,6 @@ jobs:with:sparse-checkout: .github- uses: ./.github/actions/cache-checkout- with:- mode: restore- uses: ./.github/actions/yarn-install- uses: ./.github/actions/yarn-playwright-install- run: yarn prisma generatediff --git a/.github/workflows/e2e-embed-react.yml b/.github/workflows/e2e-embed-react.ymlindex 5ece5472a75..e6dc9baabe8 100644--- a/.github/workflows/e2e-embed-react.yml+++ b/.github/workflows/e2e-embed-react.yml@@ -76,8 +76,6 @@ jobs:with:sparse-checkout: .github- uses: ./.github/actions/cache-checkout- with:- mode: restore- uses: ./.github/actions/yarn-install- uses: ./.github/actions/yarn-playwright-install- run: yarn prisma generatediff --git a/.github/workflows/e2e-embed.yml b/.github/workflows/e2e-embed.ymlindex eec3307fc36..3ae85bdd5a0 100644--- a/.github/workflows/e2e-embed.yml+++ b/.github/workflows/e2e-embed.yml@@ -84,8 +84,6 @@ jobs:with:sparse-checkout: .github- uses: ./.github/actions/cache-checkout- with:- mode: restore- uses: ./.github/actions/yarn-install- uses: ./.github/actions/yarn-playwright-install- run: yarn prisma generatediff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.ymlindex 8495fef8231..9d6f702179f 100644--- a/.github/workflows/e2e.yml+++ b/.github/workflows/e2e.yml@@ -85,8 +85,6 @@ jobs:with:sparse-checkout: .github- uses: ./.github/actions/cache-checkout- with:- mode: restore- uses: ./.github/actions/yarn-install- uses: ./.github/actions/yarn-playwright-install- run: yarn prisma generatediff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.ymlindex 1ea84258531..7f8b5b83b66 100644--- a/.github/workflows/integration-tests.yml+++ b/.github/workflows/integration-tests.yml@@ -82,8 +82,6 @@ jobs:with:sparse-checkout: .github- uses: ./.github/actions/cache-checkout- with:- mode: restore- uses: ./.github/actions/yarn-install- run: yarn prisma generate- uses: ./.github/actions/cache-dbdiff --git a/.github/workflows/lint.yml b/.github/workflows/lint.ymlindex a141c1579f2..fddbd17f653 100644--- a/.github/workflows/lint.yml+++ b/.github/workflows/lint.yml@@ -13,8 +13,6 @@ jobs:with:sparse-checkout: .github- uses: ./.github/actions/cache-checkout- with:- mode: restore- uses: ./.github/actions/yarn-install- name: Run Lintrun: yarn lintdiff --git a/.github/workflows/pr.yml b/.github/workflows/pr.ymlindex b99abd9df86..130380fdbda 100644--- a/.github/workflows/pr.yml+++ b/.github/workflows/pr.yml@@ -174,11 +174,7 @@ jobs:db-cache-hit: ${{ steps.cache-db-check.outputs.cache-hit }}steps:- uses: actions/checkout@v4- - uses: ./.github/actions/dangerous-git-checkout- - name: Cache git checkout- uses: ./.github/actions/cache-checkout- with:- mode: save+ - uses: ./.github/actions/cache-checkout- name: Generate DB cache keyid: cache-db-keyuses: ./.github/actions/cache-db-keydiff --git a/.github/workflows/production-build-without-database.yml b/.github/workflows/production-build-without-database.ymlindex 512efe6ac71..58f6575521b 100644--- a/.github/workflows/production-build-without-database.yml+++ b/.github/workflows/production-build-without-database.yml@@ -46,8 +46,6 @@ jobs:with:sparse-checkout: .github- uses: ./.github/actions/cache-checkout- with:- mode: restore- uses: ./.github/actions/yarn-install- run: yarn prisma generate- name: Generate cache keydiff --git a/.github/workflows/setup-db.yml b/.github/workflows/setup-db.ymlindex 66e4ea042fd..b0667355b60 100644--- a/.github/workflows/setup-db.yml+++ b/.github/workflows/setup-db.yml@@ -50,8 +50,6 @@ jobs:with:sparse-checkout: .github- uses: ./.github/actions/cache-checkout- with:- mode: restore- uses: ./.github/actions/yarn-installif: inputs.DB_CACHE_HIT != 'true'- run: yarn prisma generatediff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.ymlindex 532ddb77a81..b1df3dc09ed 100644--- a/.github/workflows/unit-tests.yml+++ b/.github/workflows/unit-tests.yml@@ -15,8 +15,6 @@ jobs:with:sparse-checkout: .github- uses: ./.github/actions/cache-checkout- with:- mode: restore- uses: ./.github/actions/yarn-install- run: yarn prisma generate- run: yarn test -- --no-isolate