Skip to content

Commit 041b493

Browse files
committed
Switch benchmark.yml to pnpm and new directory structure
1 parent 6880765 commit 041b493

File tree

1 file changed

+28
-27
lines changed

1 file changed

+28
-27
lines changed

.github/workflows/benchmark.yml

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ jobs:
212212
uses: actions/setup-node@v4
213213
with:
214214
node-version: '22'
215-
cache: yarn
216-
cache-dependency-path: '**/yarn.lock'
215+
cache: pnpm
216+
cache-dependency-path: '**/pnpm-lock.yaml'
217217

218218
- name: Print system information
219219
run: |
@@ -222,24 +222,34 @@ jobs:
222222
echo "Current directory: "; pwd
223223
echo "Ruby version: "; ruby -v
224224
echo "Node version: "; node -v
225-
echo "Yarn version: "; yarn --version
225+
echo "Pnpm version: "; pnpm --version
226226
echo "Bundler version: "; bundle --version
227227
228-
- name: Install Node modules with Yarn for renderer package
228+
- name: Install Node modules with Pnpm for all packages
229229
run: |
230-
yarn install --no-progress --no-emoji --frozen-lockfile
231-
npm install --global yalc
230+
pnpm install --recursive --frozen-lockfile
231+
pnpm add --global yalc
232232
233233
- name: yalc publish for react-on-rails
234-
run: cd packages/react-on-rails && yarn install --no-progress --no-emoji --frozen-lockfile && yalc publish
234+
run: cd packages/react-on-rails && yalc publish
235235

236-
- name: yalc add react-on-rails
236+
# TODO only needed while we use --ignore-workspace below
237+
- name: Cache core dummy app node modules
237238
if: env.RUN_CORE
238-
run: cd react_on_rails/spec/dummy && yalc add react-on-rails
239+
uses: actions/cache@v4
240+
with:
241+
path: react_on_rails/spec/dummy/node_modules
242+
key: v4-pro-dummy-app-node-modules-cache-${{ hashFiles('pnpm-lock.yaml', 'react_on_rails/spec/dummy/package.json') }}
239243

240-
- name: Install Node modules with Yarn for Core dummy app
244+
- name: Install Node modules for the dummy app
241245
if: env.RUN_CORE
242-
run: cd react_on_rails/spec/dummy && yarn install --frozen-lockfile --no-progress --no-emoji
246+
# TODO simplify this both here and in integration tests
247+
# --ignore-workspace prevents pnpm from treating this as part of the parent workspace
248+
# The dummy app doesn't have a pnpm-lock.yaml and shouldn't use frozen lockfile
249+
run: |
250+
cd react_on_rails/spec/dummy
251+
yalc add react-on-rails
252+
pnpm install --ignore-workspace
243253
244254
- name: Save Core dummy app ruby gems to cache
245255
if: env.RUN_CORE
@@ -356,19 +366,12 @@ jobs:
356366
# ============================================
357367
# STEP 6: SETUP PRO APPLICATION SERVER
358368
# ============================================
359-
- name: Cache Pro package node modules
360-
if: env.RUN_PRO
361-
uses: actions/cache@v4
362-
with:
363-
path: react_on_rails_pro/node_modules
364-
key: v4-pro-package-node-modules-cache-${{ hashFiles('react_on_rails_pro/yarn.lock') }}
365-
366369
- name: Cache Pro dummy app node modules
367370
if: env.RUN_PRO
368371
uses: actions/cache@v4
369372
with:
370373
path: react_on_rails_pro/spec/dummy/node_modules
371-
key: v4-pro-dummy-app-node-modules-cache-${{ hashFiles('react_on_rails_pro/spec/dummy/yarn.lock') }}
374+
key: v4-pro-dummy-app-node-modules-cache-${{ hashFiles('pnpm-lock.yaml', 'react_on_rails_pro/spec/dummy/package.json') }}
372375

373376
- name: Cache Pro dummy app Ruby gems
374377
if: env.RUN_PRO
@@ -377,16 +380,14 @@ jobs:
377380
path: react_on_rails_pro/spec/dummy/vendor/bundle
378381
key: v4-pro-dummy-app-gem-cache-${{ hashFiles('react_on_rails_pro/spec/dummy/Gemfile.lock') }}
379382

380-
- name: Install Node modules with Yarn for Pro package
383+
# Same reason for --ignore-workspace as for core
384+
# TODO Remove it here as well
385+
- name: Install Node modules with Pnpm for Pro dummy app
381386
if: env.RUN_PRO
382387
run: |
383-
cd react_on_rails_pro
384-
sudo yarn global add yalc
385-
yarn install --frozen-lockfile --no-progress --no-emoji
386-
387-
- name: Install Node modules with Yarn for Pro dummy app
388-
if: env.RUN_PRO
389-
run: cd react_on_rails_pro/spec/dummy && yarn install --frozen-lockfile --no-progress --no-emoji
388+
cd react_on_rails_pro/spec/dummy
389+
yalc add react-on-rails
390+
pnpm install --ignore-workspace
390391
391392
- name: Install Ruby Gems for Pro dummy app
392393
if: env.RUN_PRO

0 commit comments

Comments
 (0)