name: "Install Dependencies" description: "Install dependencies, fetching from cache when possible" inputs: # We run all jobs on Node.js 22 by default, as this is the most stable and supported version right now. # # Pinned to 22.23.1 (rather than floating `22`) until it's safe to float back: # Node 22.23.0 regressed node-fetch@2 keep-alive responses with # ERR_STREAM_PREMATURE_CLOSE (nodejs/node#63989, fixed in 22.23.1). node-version: description: the version of Node.js to install default: 22.23.1 turbo-api: description: the api URL for connecting to the turbo remote cache turbo-team: description: the team identifier for connecting to the turbo remote cache turbo-token: description: the api token for connecting to the turbo remote cache turbo-signature: description: the cache signature key for connecting to the turbo remote cache disable-cache: description: when "true", skip the pnpm store cache on setup-node (defense in depth for release builds) default: "false" runs: using: "composite" steps: - name: Install pnpm uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Install Node.js ${{ inputs.node-version }} (with pnpm cache) if: inputs.disable-cache != 'true' uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: ${{ inputs.node-version }} cache: "pnpm" registry-url: "https://registry.npmjs.org" - name: Install Node.js ${{ inputs.node-version }} (without pnpm cache) if: inputs.disable-cache == 'true' uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: ${{ inputs.node-version }} registry-url: "https://registry.npmjs.org" # Enable node compile cache (effective for Node 22+) # See https://nodejs.org/docs/v24.11.1/api/module.html#module-compile-cache - name: Enable Node Compile Cache shell: bash run: echo "NODE_COMPILE_CACHE=$HOME/.node_compile_cache" >> $GITHUB_ENV - name: "Configure turbo repo cache environment variables" if: inputs.turbo-api shell: bash run: | echo "TURBO_API=${{ inputs.turbo-api }}" >> $GITHUB_ENV echo "TURBO_TEAM=${{ inputs.turbo-team }}" >> $GITHUB_ENV echo "TURBO_TOKEN=${{ inputs.turbo-token }}" >> $GITHUB_ENV echo "TURBO_REMOTE_CACHE_SIGNATURE_KEY=${{ inputs.turbo-signature }}" >> $GITHUB_ENV echo "TURBO_ENV_MODE=loose" >> $GITHUB_ENV - name: Install NPM Dependencies shell: bash run: pnpm install --frozen-lockfile