Skip to content

Commit 39bf818

Browse files
committed
chore: update dependency installation to use pnpm action
1 parent f6d8392 commit 39bf818

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

.github/actions/install-dep/action.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,25 @@ on:
1111
runs:
1212
using: 'composite'
1313
steps:
14-
- uses: actions/setup-node@v2
14+
- uses: actions/setup-node@v4
1515
with:
1616
node-version: ${{ inputs.nodeVersion }}
17-
- name: Get npm cache directory
18-
id: npm-cache-dir
17+
18+
- name: Setup pnpm
19+
uses: pnpm/action-setup@v4
20+
21+
- name: Get pnpm store directory
22+
id: pnpm-cache
1923
shell: bash
20-
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
21-
- uses: actions/cache@v3
22-
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
24+
run: echo "dir=$(pnpm store path)" >> ${GITHUB_OUTPUT}
25+
26+
- uses: actions/cache@v4
27+
name: Setup pnpm cache
2328
with:
24-
path: ${{ steps.npm-cache-dir.outputs.dir }}
25-
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
29+
path: ${{ steps.pnpm-cache.outputs.dir }}
30+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
2631
restore-keys: |
27-
${{ runner.os }}-node-
32+
${{ runner.os }}-pnpm-store-
33+
2834
- run: pnpm install
2935
shell: bash

.github/workflows/pkg-pr-new.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
node-version: 18
1919

20-
- run: pnpm install
20+
- uses: ./.github/actions/install-dep
2121

2222
- run: npm run build
2323

.github/workflows/pr-comment-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
- uses: actions/setup-node@v4
8585
with:
8686
node-version: 18
87-
- run: pnpm install
87+
- uses: ./.github/actions/install-dep
8888
- run: npm run test:snap-update
8989
- name: Commit Snapshot
9090
run: |

0 commit comments

Comments
 (0)