Skip to content

Commit 2dce58f

Browse files
jbrockmendelclaude
andcommitted
TST: fix bench workflow inputs on push trigger
A push-triggered run has an empty inputs context, so ${{ inputs.environment }} expanded to empty and pixi consumed the task name as the --environment value. Move defaults into a job-level env block with fallbacks so both push and workflow_dispatch work. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent bf6efc7 commit 2dce58f

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

.github/workflows/bench-read-csv-windows.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ jobs:
3838
bench:
3939
runs-on: windows-2025
4040
timeout-minutes: 90
41+
# Defaults live here (not only in the workflow_dispatch `inputs`) because a
42+
# `push`-triggered run has an empty `inputs` context -- so every `inputs.x`
43+
# would expand to "" without these fallbacks. workflow_dispatch overrides
44+
# them. Job-level env propagates to every step below.
45+
env:
46+
BENCH_ENV: ${{ inputs.environment || 'py313' }}
47+
BENCH_N_ROWS: ${{ inputs.n_rows || '2000000' }}
48+
BENCH_THREADS: ${{ inputs.threads || '1 2 4' }}
49+
BENCH_N_RUNS: ${{ inputs.n_runs || '7' }}
50+
BENCH_N_WARMUP: ${{ inputs.n_warmup || '2' }}
4151
steps:
4252
- name: Checkout
4353
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
@@ -47,7 +57,7 @@ jobs:
4757
- name: Create virtual environment with Pixi
4858
uses: ./.github/actions/setup-pixi
4959
with:
50-
environment: ${{ inputs.environment }}
60+
environment: ${{ env.BENCH_ENV }}
5161

5262
- name: Remove link.EXE for Windows
5363
# https://github.com/Quansight-Labs/uarray/pull/310#issuecomment-3872989816
@@ -57,17 +67,13 @@ jobs:
5767
- name: Build pandas
5868
run: |
5969
pixi run \
60-
--environment ${{ inputs.environment }} \
70+
--environment ${{ env.BENCH_ENV }} \
6171
build-pandas \
6272
--editable \
6373
'-Csetup-args="--vsenv"'
6474
shell: bash -euox pipefail {0}
6575

6676
- name: Run benchmark
67-
env:
68-
BENCH_N_ROWS: ${{ inputs.n_rows }}
69-
BENCH_THREADS: ${{ inputs.threads }}
70-
BENCH_N_RUNS: ${{ inputs.n_runs }}
71-
BENCH_N_WARMUP: ${{ inputs.n_warmup }}
72-
run: pixi run --environment ${{ inputs.environment }} python scripts/bench_read_csv_parallel.py
77+
# BENCH_* are inherited from the job-level env block above.
78+
run: pixi run --environment ${{ env.BENCH_ENV }} python scripts/bench_read_csv_parallel.py
7379
shell: bash -euox pipefail {0}

0 commit comments

Comments
 (0)