From 24a66ac0b5f7bcdd0265820e222d8965e2b20735 Mon Sep 17 00:00:00 2001 From: Thomas Carmet <8408330+tcarmet@users.noreply.github.com> Date: Thu, 9 Jul 2026 15:55:04 -0700 Subject: [PATCH 1/2] CLDSRV-955: Cache node_modules instead of yarn download cache Replace `cache: yarn` (which only caches the yarn download dir) with an actions/cache on node_modules keyed by the yarn.lock hash, and make the yarn install / typescript steps conditional on a cache miss. Because the git dependencies compile TypeScript at install time, a warm cache now skips the clone, tsc build and relink entirely. Applied to the setup-ci composite action (used by all functional jobs) and the lint, async-migration-report, unit-tests and cleanup-gcp-buckets jobs. --- .github/actions/setup-ci/action.yaml | 17 +++++++++++-- .github/workflows/tests.yaml | 38 +++++++++++++++++++++++++--- 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/.github/actions/setup-ci/action.yaml b/.github/actions/setup-ci/action.yaml index 975bc3c483..ea365a9c9b 100644 --- a/.github/actions/setup-ci/action.yaml +++ b/.github/actions/setup-ci/action.yaml @@ -26,16 +26,29 @@ runs: set -exu; mkdir -p /tmp/coverage/${JOB_NAME}/; - uses: actions/setup-node@v4 + id: node with: node-version: '22.23.1' - cache: 'yarn' + # Cache node_modules directly (not the yarn download cache) so the git + # dependencies' TypeScript compilation and relink are skipped on a hit. + # Key includes runner.os and the resolved Node version because node_modules + # can hold native addons compiled for a specific OS/Node; the Node version + # is taken from the setup-node output rather than hardcoded. + - name: Cache node_modules + id: cache-node-modules + uses: actions/cache@v6 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ steps.node.outputs.node-version }}-modules-${{ hashFiles('yarn.lock') }} - name: install typescript shell: bash + if: steps.cache-node-modules.outputs.cache-hit != 'true' run: yarn global add typescript@4.9.5 - name: install dependencies shell: bash + if: steps.cache-node-modules.outputs.cache-hit != 'true' run: yarn install --ignore-engines --frozen-lockfile --network-concurrency 1 - - uses: actions/cache@v3 + - uses: actions/cache@v6 with: path: ~/.cache/pip key: ${{ runner.os }}-pip diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d775a2b8d1..f96a040dc7 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -84,13 +84,21 @@ jobs: with: fetch-depth: 0 - uses: actions/setup-node@v4 + id: node with: node-version: '22.23.1' - cache: yarn + - name: Cache node_modules + id: cache-node-modules + uses: actions/cache@v6 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ steps.node.outputs.node-version }}-modules-${{ hashFiles('yarn.lock') }} - name: install typescript shell: bash + if: steps.cache-node-modules.outputs.cache-hit != 'true' run: yarn global add typescript@4.9.5 - name: install dependencies + if: steps.cache-node-modules.outputs.cache-hit != 'true' run: yarn install --frozen-lockfile --network-concurrency 1 - uses: actions/setup-python@v5 with: @@ -125,10 +133,17 @@ jobs: - name: Checkout uses: actions/checkout@v4 - uses: actions/setup-node@v4 + id: node with: node-version: '22.23.1' - cache: yarn + - name: Cache node_modules + id: cache-node-modules + uses: actions/cache@v6 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ steps.node.outputs.node-version }}-modules-${{ hashFiles('yarn.lock') }} - name: install dependencies + if: steps.cache-node-modules.outputs.cache-hit != 'true' run: yarn install --frozen-lockfile --network-concurrency 1 - name: Count async/await migration progress run: yarn run count-async @@ -139,13 +154,21 @@ jobs: - name: Checkout uses: actions/checkout@v4 - uses: actions/setup-node@v4 + id: node with: node-version: '22.23.1' - cache: yarn + - name: Cache node_modules + id: cache-node-modules + uses: actions/cache@v6 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ steps.node.outputs.node-version }}-modules-${{ hashFiles('yarn.lock') }} - name: install typescript shell: bash + if: steps.cache-node-modules.outputs.cache-hit != 'true' run: yarn global add typescript@4.9.5 - name: install dependencies + if: steps.cache-node-modules.outputs.cache-hit != 'true' run: yarn install --frozen-lockfile --network-concurrency 1 - name: Unit Coverage run: | @@ -1087,10 +1110,17 @@ jobs: - name: Checkout uses: actions/checkout@v4 - uses: actions/setup-node@v4 + id: node with: node-version: '22.23.1' - cache: yarn + - name: Cache node_modules + id: cache-node-modules + uses: actions/cache@v6 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ steps.node.outputs.node-version }}-modules-${{ hashFiles('yarn.lock') }} - name: Install dependencies + if: steps.cache-node-modules.outputs.cache-hit != 'true' run: yarn install --frozen-lockfile --network-concurrency 1 - name: Delete stale GCP CI buckets run: yarn run cleanup_gcp_buckets From b9c4715ddd07eff59e5f5bf93a8dbe51c70c97c5 Mon Sep 17 00:00:00 2001 From: Thomas Carmet <8408330+tcarmet@users.noreply.github.com> Date: Fri, 10 Jul 2026 09:51:03 -0700 Subject: [PATCH 2/2] CLDSRV-955: Satisfy prettier on setup-ci action.yaml The prettier check formats whole changed files; touching action.yaml brought its pre-existing double-quoted name/description into scope. Reformat them to single quotes to match the prettier style. --- .github/actions/setup-ci/action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-ci/action.yaml b/.github/actions/setup-ci/action.yaml index ea365a9c9b..d997bb42ca 100644 --- a/.github/actions/setup-ci/action.yaml +++ b/.github/actions/setup-ci/action.yaml @@ -1,6 +1,6 @@ --- -name: "Setup CI environment" -description: "Setup Cloudserver CI environment" +name: 'Setup CI environment' +description: 'Setup Cloudserver CI environment' runs: using: composite