Skip to content

Commit 51db9a6

Browse files
committed
Fix app version handling in the benchmark workflow
1 parent 21beeae commit 51db9a6

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

.github/workflows/benchmark.yml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ env:
6767
FORTIO_VERSION: "1.73.0"
6868
K6_VERSION: "1.3.0"
6969
VEGETA_VERSION: "12.13.0"
70+
APP_VERSION: ${{ github.event.inputs.app_version || 'pro_only' }}
7071
# Benchmark parameters (defaults in bench.rb unless overridden here for CI)
7172
ROUTES: ${{ github.event.inputs.routes }}
7273
RATE: ${{ github.event.inputs.rate || 'max' }}
@@ -213,22 +214,22 @@ jobs:
213214
run: cd packages/react-on-rails && yarn install --no-progress --no-emoji --frozen-lockfile && yalc publish
214215

215216
- name: yalc add react-on-rails
216-
if: github.event.inputs.app_version != 'pro_only'
217+
if: env.APP_VERSION != 'pro_only'
217218
run: cd spec/dummy && yalc add react-on-rails
218219

219220
- name: Install Node modules with Yarn for dummy app
220-
if: github.event.inputs.app_version != 'pro_only'
221+
if: env.APP_VERSION != 'pro_only'
221222
run: cd spec/dummy && yarn install --no-progress --no-emoji
222223

223224
- name: Save dummy app ruby gems to cache
224-
if: github.event.inputs.app_version != 'pro_only'
225+
if: env.APP_VERSION != 'pro_only'
225226
uses: actions/cache@v4
226227
with:
227228
path: spec/dummy/vendor/bundle
228229
key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}
229230

230231
- name: Install Ruby Gems for dummy app
231-
if: github.event.inputs.app_version != 'pro_only'
232+
if: env.APP_VERSION != 'pro_only'
232233
run: |
233234
cd spec/dummy
234235
bundle lock --add-platform 'x86_64-linux'
@@ -237,7 +238,7 @@ jobs:
237238
fi
238239
239240
- name: Prepare production assets
240-
if: github.event.inputs.app_version != 'pro_only'
241+
if: env.APP_VERSION != 'pro_only'
241242
run: |
242243
set -e # Exit on any error
243244
echo "🔨 Building production assets..."
@@ -251,7 +252,7 @@ jobs:
251252
echo "✅ Production assets built successfully"
252253
253254
- name: Start production server
254-
if: github.event.inputs.app_version != 'pro_only'
255+
if: env.APP_VERSION != 'pro_only'
255256
run: |
256257
set -e # Exit on any error
257258
echo "🚀 Starting production server..."
@@ -280,7 +281,7 @@ jobs:
280281
# ============================================
281282

282283
- name: Execute Core benchmark suite
283-
if: github.event.inputs.app_version != 'pro_only'
284+
if: env.APP_VERSION != 'pro_only'
284285
timeout-minutes: 120
285286
run: |
286287
set -e # Exit on any error
@@ -294,7 +295,7 @@ jobs:
294295
echo "✅ Benchmark suite completed successfully"
295296
296297
- name: Validate Core benchmark results
297-
if: github.event.inputs.app_version != 'pro_only'
298+
if: env.APP_VERSION != 'pro_only'
298299
run: |
299300
set -e # Exit on any error
300301
echo "🔍 Validating benchmark output files..."
@@ -334,7 +335,7 @@ jobs:
334335
335336
- name: Upload Core benchmark results
336337
uses: actions/upload-artifact@v4
337-
if: github.event.inputs.app_version != 'pro_only' && always()
338+
if: env.APP_VERSION != 'pro_only' && always()
338339
with:
339340
name: benchmark-core-results-${{ github.run_number }}
340341
path: bench_results/
@@ -345,50 +346,50 @@ jobs:
345346
# STEP 6: SETUP PRO APPLICATION SERVER
346347
# ============================================
347348
- name: Cache Pro package node modules
348-
if: github.event.inputs.app_version != 'core_only'
349+
if: env.APP_VERSION != 'core_only'
349350
uses: actions/cache@v4
350351
with:
351352
path: react_on_rails_pro/node_modules
352353
key: v4-pro-package-node-modules-cache-${{ hashFiles('react_on_rails_pro/yarn.lock') }}
353354

354355
- name: Cache Pro dummy app node modules
355-
if: github.event.inputs.app_version != 'core_only'
356+
if: env.APP_VERSION != 'core_only'
356357
uses: actions/cache@v4
357358
with:
358359
path: react_on_rails_pro/spec/dummy/node_modules
359360
key: v4-pro-dummy-app-node-modules-cache-${{ hashFiles('react_on_rails_pro/spec/dummy/yarn.lock') }}
360361

361362
- name: Cache Pro dummy app Ruby gems
362-
if: github.event.inputs.app_version != 'core_only'
363+
if: env.APP_VERSION != 'core_only'
363364
uses: actions/cache@v4
364365
with:
365366
path: react_on_rails_pro/spec/dummy/vendor/bundle
366367
key: v4-pro-dummy-app-gem-cache-${{ hashFiles('react_on_rails_pro/spec/dummy/Gemfile.lock') }}
367368

368369
- name: Install Node modules with Yarn for Pro package
369-
if: github.event.inputs.app_version != 'core_only'
370+
if: env.APP_VERSION != 'core_only'
370371
run: |
371372
cd react_on_rails_pro
372373
sudo yarn global add yalc
373374
yarn install --frozen-lockfile --no-progress --no-emoji
374375
375376
- name: Install Node modules with Yarn for Pro dummy app
376-
if: github.event.inputs.app_version != 'core_only'
377+
if: env.APP_VERSION != 'core_only'
377378
run: cd react_on_rails_pro/spec/dummy && yarn install --frozen-lockfile --no-progress --no-emoji
378379

379380
- name: Install Ruby Gems for Pro dummy app
380-
if: github.event.inputs.app_version != 'core_only'
381+
if: env.APP_VERSION != 'core_only'
381382
run: |
382383
cd react_on_rails_pro/spec/dummy
383384
bundle lock --add-platform 'x86_64-linux'
384385
bundle _2.5.4_ check || bundle _2.5.4_ install --jobs=4 --retry=3
385386
386387
- name: Generate file-system based entrypoints for Pro
387-
if: github.event.inputs.app_version != 'core_only'
388+
if: env.APP_VERSION != 'core_only'
388389
run: cd react_on_rails_pro/spec/dummy && bundle exec rake react_on_rails:generate_packs
389390

390391
- name: Prepare Pro production assets
391-
if: github.event.inputs.app_version != 'core_only'
392+
if: env.APP_VERSION != 'core_only'
392393
run: |
393394
set -e
394395
echo "🔨 Building Pro production assets..."
@@ -402,7 +403,7 @@ jobs:
402403
echo "✅ Production assets built successfully"
403404
404405
- name: Start Pro production server
405-
if: github.event.inputs.app_version != 'core_only'
406+
if: env.APP_VERSION != 'core_only'
406407
run: |
407408
set -e
408409
echo "🚀 Starting Pro production server..."
@@ -431,7 +432,7 @@ jobs:
431432
# ============================================
432433

433434
- name: Execute Pro benchmark suite
434-
if: github.event.inputs.app_version != 'core_only'
435+
if: env.APP_VERSION != 'core_only'
435436
timeout-minutes: 120
436437
run: |
437438
set -e
@@ -445,7 +446,7 @@ jobs:
445446
echo "✅ Benchmark suite completed successfully"
446447
447448
- name: Validate Pro benchmark results
448-
if: github.event.inputs.app_version != 'core_only'
449+
if: env.APP_VERSION != 'core_only'
449450
run: |
450451
set -e
451452
echo "🔍 Validating Pro benchmark output files..."
@@ -481,7 +482,7 @@ jobs:
481482
482483
- name: Upload Pro benchmark results
483484
uses: actions/upload-artifact@v4
484-
if: github.event.inputs.app_version != 'core_only' && always()
485+
if: env.APP_VERSION != 'core_only' && always()
485486
with:
486487
name: benchmark-pro-results-${{ github.run_number }}
487488
path: bench_results/
@@ -500,7 +501,7 @@ jobs:
500501
echo "Run number: ${{ github.run_number }}"
501502
echo "Triggered by: ${{ github.actor }}"
502503
echo "Branch: ${{ github.ref_name }}"
503-
echo "App version: ${{ github.event.inputs.app_version || 'both' }}"
504+
echo "App version: ${{ env.APP_VERSION }}"
504505
echo ""
505506
if [ "${{ job.status }}" == "success" ]; then
506507
echo "✅ All steps completed successfully"

0 commit comments

Comments
 (0)