Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions shared-actions/setup-node-with-cache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'` |
Expand Down
10 changes: 10 additions & 0 deletions shared-actions/setup-node-with-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading