Skip to content

Commit 81a46df

Browse files
ci: Shared node/pnpm action (#110)
* Try custom node/pnpm action * Test updating pnpm-lock * Try env * Try this * Remove 2nd cache * Try absolute path * Try this path * Revert package version * Try removing shell * Oops * Undo
1 parent 6415623 commit 81a46df

File tree

3 files changed

+29
-18
lines changed

3 files changed

+29
-18
lines changed

.github/setup/action.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Setup Tools
2+
description: Action that sets up Node, pnpm, and caching
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Setup pnpm
7+
uses: pnpm/action-setup@v4
8+
- name: Setup Node
9+
uses: actions/setup-node@v4
10+
with:
11+
node-version-file: .nvmrc
12+
- name: Get pnpm store directory
13+
shell: bash
14+
run: |
15+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
16+
- name: Setup pnpm cache
17+
uses: actions/cache@v4
18+
with:
19+
path: ${{ env.STORE_PATH }}
20+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
21+
restore-keys: |
22+
${{ runner.os }}-pnpm-store-
23+
- name: Install dependencies
24+
shell: bash
25+
run: pnpm install --frozen-lockfile

.github/workflows/ci.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,8 @@ jobs:
2626
uses: actions/checkout@v4
2727
with:
2828
fetch-depth: '0'
29-
- name: Setup pnpm
30-
uses: pnpm/action-setup@v4
31-
- name: Setup Node
32-
uses: actions/setup-node@v4
33-
with:
34-
node-version-file: .nvmrc
35-
cache: pnpm
36-
- name: Install dependencies
37-
run: pnpm install --frozen-lockfile --prefer-offline
29+
- name: Setup Tools
30+
uses: tanstack/config/.github/setup@main
3831
- name: Run Tests
3932
run: pnpm run test:ci
4033
- name: Publish

.github/workflows/pr.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,8 @@ jobs:
2323
uses: actions/checkout@v4
2424
with:
2525
fetch-depth: 0
26-
- name: Setup pnpm
27-
uses: pnpm/action-setup@v4
28-
- name: Setup Node
29-
uses: actions/setup-node@v4
30-
with:
31-
node-version-file: .nvmrc
32-
cache: pnpm
33-
- name: Install dependencies
34-
run: pnpm install --frozen-lockfile --prefer-offline
26+
- name: Setup Tools
27+
uses: tanstack/config/.github/setup@main
3528
- name: Get base and head commits for `nx affected`
3629
uses: nrwl/nx-set-shas@v4
3730
with:

0 commit comments

Comments
 (0)