From 0c68480bca939c631110caa29a6c85b1d2092d66 Mon Sep 17 00:00:00 2001 From: Waqar Ali Date: Sun, 29 Nov 2026 05:47:27 +0100 Subject: [PATCH] feat(NOJIRA-123): add opt-in turbo-cache input to setup-node-with-cache Jobs that run `turbo run` outside frontend-pr-workflow add rharkor/caching-for-turbo after setup-node-with-cache by hand (automations, bob-the-builder, pages). A `turbo-cache` input (default false) runs the same step, at the same pin as frontend-pr-workflow, so they don't have to. Co-Authored-By: Claude Opus 5.5 --- shared-actions/setup-node-with-cache/README.md | 1 + shared-actions/setup-node-with-cache/action.yml | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/shared-actions/setup-node-with-cache/README.md b/shared-actions/setup-node-with-cache/README.md index 2860013..0c05ae7 100644 --- a/shared-actions/setup-node-with-cache/README.md +++ b/shared-actions/setup-node-with-cache/README.md @@ -32,6 +32,7 @@ Standardized Node.js setup with enhanced yarn/pnpm caching and GitHub packages r |-------|-------------|----------|---------| | `node-version` | Node.js version to use (ignored if use-asdf is true) | No | `'20'` | | `use-asdf` | Use asdf-vm for version management | No | `'false'` | +| `turbo-cache` | Set up the Turborepo cache ([rharkor/caching-for-turbo](https://github.com/rharkor/caching-for-turbo)) for jobs that run `turbo run` | No | `'false'` | | `GH_TOKEN` | GitHub token for private packages | Yes | - | | `package-manager` | Package manager: `yarn` or `pnpm` | No | `'yarn'` | | `enable-yarn-cache` | Enable yarn global cache (~/.cache/yarn) | No | `'true'` | diff --git a/shared-actions/setup-node-with-cache/action.yml b/shared-actions/setup-node-with-cache/action.yml index 408a32c..d1e0b1d 100644 --- a/shared-actions/setup-node-with-cache/action.yml +++ b/shared-actions/setup-node-with-cache/action.yml @@ -9,6 +9,10 @@ inputs: description: 'Use asdf-vm for version management (reads from .tool-versions)' required: false default: 'false' + turbo-cache: + description: 'Restore and save the Turborepo cache through the GitHub Actions cache (rharkor/caching-for-turbo), for jobs that run `turbo run`' + required: false + default: 'false' GH_TOKEN: description: 'GitHub token for private packages' required: true @@ -95,6 +99,12 @@ runs: npm config set '//npm.pkg.github.com/:_authToken' ${{ inputs.GH_TOKEN }} npm config set @typeform:registry https://npm.pkg.github.com/ + # Turborepo cache: turbo run reads and writes task outputs through a local server backed by + # the GitHub Actions cache. Same pin as frontend-pr-workflow's turbo-cache steps. + - name: Setup Turbo cache + if: ${{ inputs.turbo-cache == 'true' && !env.ACT }} + uses: rharkor/caching-for-turbo@2238fae6eb9a9936f92356f54cb3660200d105e7 # v2.5.1 + # Cache 2: package manager dependencies (node_modules and package-manager global cache) # This cache changes whenever package.json or lockfile is modified. # It's separate from the asdf cache so that dependency updates don't invalidate