diff --git a/.github/actions/cache-checkout/action.yml b/.github/actions/cache-checkout/action.yml index d7bbf1fe51..2f6779e1bb 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-checkout with: path: | . @@ -19,15 +13,14 @@ runs: !node_modules !**/node_modules key: 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@v4 with: - 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/ + !**/*.mp4 diff --git a/.github/workflows/api-v1-production-build.yml b/.github/workflows/api-v1-production-build.yml index 380340d37d..02e534ce24 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 build diff --git a/.github/workflows/api-v2-production-build.yml b/.github/workflows/api-v2-production-build.yml index 2d2e9cb472..fe25f6604d 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 schemas working-directory: apps/api/v2 diff --git a/.github/workflows/api-v2-unit-tests.yml b/.github/workflows/api-v2-unit-tests.yml index bc33f8b4a8..8eb08509ca 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 tests diff --git a/.github/workflows/atoms-production-build.yml b/.github/workflows/atoms-production-build.yml index ef6f9a4210..3552cb5a75 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 build uses: actions/cache@v4 diff --git a/.github/workflows/check-api-v2-breaking-changes.yml b/.github/workflows/check-api-v2-breaking-changes.yml index 270f0bd08c..102d837f9c 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 Swagger diff --git a/.github/workflows/check-types.yml b/.github/workflows/check-types.yml index bd2da47672..dfccf1abaf 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 info run: node -e "console.log(require('v8').getHeapStatistics())" diff --git a/.github/workflows/companion-build.yml b/.github/workflows/companion-build.yml index 58cd1be35d..c0f10dc328 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 Bun uses: oven-sh/setup-bun@v1 diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index 6e869ff753..3b573b7a8a 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 build uses: actions/cache@v4 id: cache-docs-build diff --git a/.github/workflows/e2e-api-v2.yml b/.github/workflows/e2e-api-v2.yml index 9656c4b473..5c05003be7 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 Turbo diff --git a/.github/workflows/e2e-app-store.yml b/.github/workflows/e2e-app-store.yml index d7bede4762..a89e2e9124 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 generate diff --git a/.github/workflows/e2e-embed-react.yml b/.github/workflows/e2e-embed-react.yml index 5ece5472a7..e6dc9baabe 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 generate diff --git a/.github/workflows/e2e-embed.yml b/.github/workflows/e2e-embed.yml index eec3307fc3..3ae85bdd5a 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 generate diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 8495fef823..9d6f702179 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 generate diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 1ea8425853..7f8b5b83b6 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-db diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a141c1579f..fddbd17f65 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 Lint run: yarn lint diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b99abd9df8..130380fdbd 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 key id: cache-db-key uses: ./.github/actions/cache-db-key diff --git a/.github/workflows/production-build-without-database.yml b/.github/workflows/production-build-without-database.yml index 512efe6ac7..58f6575521 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 key diff --git a/.github/workflows/setup-db.yml b/.github/workflows/setup-db.yml index 66e4ea042f..b0667355b6 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-install if: inputs.DB_CACHE_HIT != 'true' - run: yarn prisma generate diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 532ddb77a8..b1df3dc09e 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