Skip to content

Commit 141ed09

Browse files
committed
CI: Test under pnpm's isolated node_modules
#2116, #2257 etc fixed some missing dependencies, now we close the loop by ensuring we can't regress. This adds a `test-pnpm` job to `build-test-and-deploy`. It generates `pnpm-lock.yaml` from `yarn.lock` with `pnpm import`, installs, and runs Flow, `typecheck-ts`, lint and Jest (with the same retries as the Yarn test job). It doesn't need to run on multiple platforms / versions so it's just Ubuntu and Node LTS. Changelog: Internal Test plan: `actionlint` passes. Ran the job's steps locally against a fresh copy of this PR, with pnpm 12.21.0 (on Node 22.13 rather than 24) - all pass, including Jest (175 suites, 3475 tests). CI on this PR runs the new job.
1 parent 49ecda9 commit 141ed09

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

‎.github/workflows/build-test-and-deploy.yml‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,39 @@ jobs:
6565
node-version: ${{ matrix.node-version }}
6666
runs-on: ${{ matrix.runs-on }}
6767

68+
# Yarn hoists everything into the root node_modules, which can hide
69+
# undeclared dependencies. pnpm's isolated node_modules catches them.
70+
test-pnpm:
71+
runs-on: ubuntu-latest
72+
name: "Tests [pnpm, isolated node_modules]"
73+
steps:
74+
- uses: actions/checkout@v7
75+
- uses: pnpm/action-setup@v6
76+
with:
77+
version: 12
78+
- uses: actions/setup-node@v6
79+
with:
80+
node-version: 'lts/*'
81+
# yarn.lock is the source of truth - generate pnpm-lock.yaml from it
82+
- run: pnpm import
83+
- run: pnpm install --frozen-lockfile
84+
- run: pnpm run typecheck
85+
- run: pnpm run typecheck-ts
86+
- run: pnpm run lint
87+
- name: Run Jest Tests
88+
run: |
89+
max_attempts=3
90+
attempt=1
91+
until pnpm exec jest --ci --maxWorkers 4; do
92+
if [ $attempt -ge $max_attempts ]; then
93+
echo "Tests failed after $max_attempts attempts"
94+
exit 1
95+
fi
96+
echo "Attempt $attempt failed, retrying..."
97+
attempt=$((attempt + 1))
98+
sleep 5
99+
done
100+
68101
deploy:
69102
# runs only on tag pushes
70103
if: ${{ github.ref_type == 'tag' }}

0 commit comments

Comments
 (0)