Skip to content

Commit 1cdcd97

Browse files
committed
chore: add workspace to cache key
1 parent b4abbe5 commit 1cdcd97

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

.github/actions/npm-setup/action.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ inputs:
88
node-version:
99
description: 'Node.js version to use'
1010
required: true
11+
workspace:
12+
description: 'Key for the cache'
13+
required: true
1114

1215
runs:
1316
using: "composite"
@@ -20,9 +23,9 @@ runs:
2023
id: npm-cache
2124
with:
2225
path: node_modules
23-
key: ${{ github.head_ref || 'main' }}-${{ inputs.runner }}-node-${{ inputs.node-version }}-${{ hashFiles('**/package-lock.json') }}
26+
key: ${{ github.head_ref || 'main' }}-${{ inputs.runner }}-node-${{ inputs.node-version }}-${{ inputs.workspace }}-${{ hashFiles('**/package-lock.json') }}
2427
restore-keys: |
25-
${{ github.head_ref || 'main' }}-${{ inputs.runner }}-node-${{ inputs.node-version }}-
28+
${{ github.head_ref || 'main' }}-${{ inputs.runner }}-node-${{ inputs.node-version }}-${{ inputs.workspace }}-
2629
- name: Install dependencies
2730
if: steps.npm-cache.outputs.cache-hit != 'true'
2831
shell: bash

.github/workflows/lint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ jobs:
1919
with:
2020
runner: ubuntu-22.04
2121
node-version: 22.x
22+
workspace: "packages/testcontainers"
2223
- name: Code linting
2324
run: npm run lint:ci

.github/workflows/test-template.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ jobs:
135135
with:
136136
runner: ${{ inputs.runner }}
137137
node-version: ${{ inputs.node-version }}
138+
workspace: "${{ inputs.workspace }}"
138139

139140
- name: Run tests
140141
run: npm run test:ci -- ${{ inputs.workspace }}

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
with:
3737
runner: ${{ matrix.runner }}
3838
node-version: ${{ matrix.node-version }}
39+
workspace: "packages/testcontainers"
3940

4041
- name: Build workspaces
4142
run: npm run build -ws

0 commit comments

Comments
 (0)