11name : Generate Windows Benchmark Baseline
22
33on :
4+ push :
5+ branches :
6+ - python-upgrade
47 workflow_dispatch :
58 inputs :
69 python_version :
@@ -20,14 +23,16 @@ permissions:
2023jobs :
2124 windows_benchmark_baseline :
2225 runs-on : windows-latest
26+ env :
27+ PYTHON_VERSION : ${{ github.event.inputs.python_version || '3.14' }}
2328
2429 steps :
2530 - uses : actions/checkout@v4
2631
27- - name : Set up Python ${{ inputs.python_version }}
32+ - name : Set up Python ${{ env.PYTHON_VERSION }}
2833 uses : actions/setup-python@v5
2934 with :
30- python-version : ${{ inputs.python_version }}
35+ python-version : ${{ env.PYTHON_VERSION }}
3136
3237 - name : Install dependencies
3338 run : |
3944 run : |
4045 pytest -c "." --benchmark-storage=.benchmarks/ --benchmark-save=benchmark tests/benchmarks.py
4146
42- $benchDir = ".benchmarks/Windows-CPython-${{ inputs.python_version }}-64bit"
47+ $benchDir = ".benchmarks/Windows-CPython-${{ env.PYTHON_VERSION }}-64bit"
4348 if (-not (Test-Path $benchDir)) {
4449 throw "Benchmark directory not found: $benchDir"
4550 }
@@ -56,16 +61,16 @@ jobs:
5661 - name : Upload benchmark baseline artifact
5762 uses : actions/upload-artifact@v4
5863 with :
59- name : windows-cpython-${{ inputs.python_version }}-benchmark-baseline
60- path : .benchmarks/Windows-CPython-${{ inputs.python_version }}-64bit/0001_benchmark.json
64+ name : windows-cpython-${{ env.PYTHON_VERSION }}-benchmark-baseline
65+ path : .benchmarks/Windows-CPython-${{ env.PYTHON_VERSION }}-64bit/0001_benchmark.json
6166
6267 - name : Create pull request with baseline
63- if : ${{ inputs.open_pr }}
68+ if : ${{ github.event_name == 'workflow_dispatch' && github.event. inputs.open_pr == 'true' }}
6469 uses : peter-evans/create-pull-request@v6
6570 with :
66- commit-message : Add Windows benchmark baseline for Python ${{ inputs.python_version }}
67- title : Add Windows benchmark baseline for Python ${{ inputs.python_version }}
71+ commit-message : Add Windows benchmark baseline for Python ${{ env.PYTHON_VERSION }}
72+ title : Add Windows benchmark baseline for Python ${{ env.PYTHON_VERSION }}
6873 body : Generated by workflow_dispatch in windows-benchmark-baseline.yml.
69- branch : chore/windows-benchmark-baseline-py${{ inputs.python_version }}
74+ branch : chore/windows-benchmark-baseline-py${{ env.PYTHON_VERSION }}
7075 add-paths : |
71- .benchmarks/Windows-CPython-${{ inputs.python_version }}-64bit/0001_benchmark.json
76+ .benchmarks/Windows-CPython-${{ env.PYTHON_VERSION }}-64bit/0001_benchmark.json
0 commit comments