Skip to content

Commit 217f430

Browse files
wochingeclaude
andcommitted
ci: cache pnpm store instead of node_modules to avoid stale server state
Caching node_modules directly caused postinstall hooks (e.g. prisma generate) to be skipped, leading to stale generated artifacts that didn't match the current langfuse-server schema. Cache the pnpm store instead so installs are still fast but hooks run properly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8ea1c54 commit 217f430

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,26 @@ jobs:
8181
version: 10.33.0
8282

8383
- name: Clone langfuse server
84+
id: clone-server
8485
run: |
85-
git clone https://github.com/langfuse/langfuse.git ./langfuse-server && echo $(cd ./langfuse-server && git rev-parse HEAD)
86+
git clone https://github.com/langfuse/langfuse.git ./langfuse-server
87+
echo "sha=$(cd ./langfuse-server && git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
8688
8789
- name: Setup node (for langfuse server)
8890
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
8991
with:
9092
node-version: 24
9193

92-
- name: Cache langfuse server dependencies
94+
# Cache the pnpm store (download cache) instead of node_modules directly.
95+
# Caching node_modules skips postinstall hooks (e.g. prisma generate),
96+
# which leads to stale generated artifacts that don't match the current schema.
97+
- name: Cache pnpm store
9398
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
9499
with:
95-
path: ./langfuse-server/node_modules
96-
key: |
97-
langfuse-server-${{ hashFiles('./langfuse-server/package-lock.json') }}
98-
langfuse-server-
100+
path: ~/.local/share/pnpm/store/v3
101+
key: pnpm-store-${{ steps.clone-server.outputs.sha }}
102+
restore-keys: |
103+
pnpm-store-
99104
100105
- name: Run langfuse server
101106
run: |

0 commit comments

Comments
 (0)