From fe7bf39d9f58661504f9c6dde6fea72af5e368c8 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Wed, 10 Jun 2026 09:09:29 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=9C=EF=B8=8F=20ci:=20Cache=20Dependenc?= =?UTF-8?q?ies=20and=20Builds=20in=20Cache=20Integration=20Tests=20(#13652?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🗜️ ci: Cache Dependencies and Builds in Cache Integration Tests Port the node_modules and package-dist caching pattern from backend-review.yml to cache-integration-tests.yml, which ran a full npm ci (~72s) and rebuilt data-provider, data-schemas, and api on every run. Cache keys are identical to backend-review.yml so the two workflows share entries. Drops setup-node's npm tarball cache, superseded by the node_modules restore, matching backend-review.yml. * 🗜️ ci: Exercise Warm-Cache Path --- .github/workflows/cache-integration-tests.yml | 51 ++++++++++++++++--- 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cache-integration-tests.yml b/.github/workflows/cache-integration-tests.yml index 3e4c5418ae..1a70e4b6b0 100644 --- a/.github/workflows/cache-integration-tests.yml +++ b/.github/workflows/cache-integration-tests.yml @@ -32,7 +32,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: '24.16.0' - cache: 'npm' - name: Install Redis tools run: | @@ -57,14 +56,54 @@ jobs: redis-cli -p 7002 cluster info || exit 1 redis-cli -p 7003 cluster info || exit 1 + - name: Restore node_modules cache + id: cache-node-modules + uses: actions/cache@v4 + with: + path: | + node_modules + api/node_modules + packages/api/node_modules + packages/data-provider/node_modules + packages/data-schemas/node_modules + key: node-modules-backend-${{ runner.os }}-24.16.0-${{ hashFiles('package-lock.json') }} + - name: Install dependencies + if: steps.cache-node-modules.outputs.cache-hit != 'true' run: npm ci - - name: Build packages - run: | - npm run build:data-provider - npm run build:data-schemas - npm run build:api + - name: Restore data-provider build cache + id: cache-data-provider + uses: actions/cache@v4 + with: + path: packages/data-provider/dist + key: build-data-provider-${{ runner.os }}-${{ hashFiles('packages/data-provider/src/**', 'packages/data-provider/tsconfig*.json', 'packages/data-provider/tsdown.config.mjs', 'packages/data-provider/package.json') }} + + - name: Build data-provider + if: steps.cache-data-provider.outputs.cache-hit != 'true' + run: npm run build:data-provider + + - name: Restore data-schemas build cache + id: cache-data-schemas + uses: actions/cache@v4 + with: + path: packages/data-schemas/dist + key: build-data-schemas-${{ runner.os }}-${{ hashFiles('packages/data-schemas/src/**', 'packages/data-schemas/tsconfig*.json', 'packages/data-schemas/tsdown.config.mjs', 'packages/data-schemas/package.json', 'packages/data-provider/src/**', 'packages/data-provider/tsconfig*.json', 'packages/data-provider/tsdown.config.mjs', 'packages/data-provider/package.json') }} + + - name: Build data-schemas + if: steps.cache-data-schemas.outputs.cache-hit != 'true' + run: npm run build:data-schemas + + - name: Restore api build cache + id: cache-api + uses: actions/cache@v4 + with: + path: packages/api/dist + key: build-api-${{ runner.os }}-${{ hashFiles('packages/api/src/**', 'packages/api/tsconfig*.json', 'packages/api/tsdown.config.mjs', 'packages/api/package.json', 'packages/data-provider/src/**', 'packages/data-provider/tsconfig*.json', 'packages/data-provider/tsdown.config.mjs', 'packages/data-provider/package.json', 'packages/data-schemas/src/**', 'packages/data-schemas/tsconfig*.json', 'packages/data-schemas/tsdown.config.mjs', 'packages/data-schemas/package.json') }} + + - name: Build api + if: steps.cache-api.outputs.cache-hit != 'true' + run: npm run build:api - name: Run all cache integration tests (Single Redis Node) working-directory: packages/api