Skip to content

Commit b2896f3

Browse files
committed
node cache
1 parent 4eec245 commit b2896f3

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

.github/actions/setup-e2e-env/action.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Setup E2E Test Environment'
1+
name: 'Setup E2E Test Environment'
22
description: 'Sets up the environment for running E2E tests'
33

44
inputs:
@@ -81,6 +81,10 @@ inputs:
8181
description: 'Target for which the keystore is being configured (e.g., qa, flask, main)'
8282
required: false
8383
default: 'qa'
84+
skip-yarn-install:
85+
description: 'Whether to skip yarn install (assumes node_modules already available)'
86+
required: false
87+
default: 'false'
8488

8589
runs:
8690
using: 'composite'
@@ -189,18 +193,26 @@ runs:
189193
run: corepack enable && corepack prepare yarn@${{ inputs.yarn-version }} --activate
190194
shell: bash
191195

192-
- name: Restore Yarn cache
196+
- name: Restore Yarn cache (cross-workflow)
197+
if: ${{ inputs.skip-yarn-install == 'false' }}
193198
uses: actions/cache@v4
194199
with:
195200
path: |
196201
node_modules
197-
key: ${{ inputs.cache-prefix }}-yarn-${{ inputs.platform }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
202+
~/.yarn/cache
203+
~/.cache/yarn
204+
key: ${{ inputs.cache-prefix }}-yarn-v2-${{ runner.os }}-${{ hashFiles('yarn.lock', 'package.json') }}
198205
restore-keys: |
199-
${{ inputs.cache-prefix }}-yarn-${{ inputs.platform }}-${{ runner.os }}-
206+
${{ inputs.cache-prefix }}-yarn-v2-${{ runner.os }}-
207+
${{ inputs.cache-prefix }}-yarn-v1-${{ runner.os }}-
200208
201209
- name: Install JavaScript dependencies
210+
if: ${{ inputs.skip-yarn-install == 'false' }}
202211
id: yarn-install
203-
run: yarn install --frozen-lockfile
212+
run: |
213+
echo "📦 Installing JavaScript dependencies..."
214+
yarn install --frozen-lockfile --prefer-offline
215+
echo "✅ JavaScript dependencies installed successfully"
204216
shell: bash
205217
env:
206218
NODE_OPTIONS: --max-old-space-size=4096 # Increase memory limit for Node.js due to large dependencies

0 commit comments

Comments
 (0)