Skip to content

Benchmarks

Benchmarks #251

Workflow file for this run

name: Benchmarks
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
inputs:
commit_ref:
description: "optional: compare to specific ref"
required: false
jobs:
benchmarks:
name: Benchmark scripts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build numpy wheel
run: |
python3 -m pip install wheel
python3 -m pip wheel numpy==2.3.4 -w ./numpy-wheel
- name: List built numpy wheel
run: ls -lh ./numpy-wheel
- name: Install cibuildwheel
# old ref is incompatible with cmake 4.0.0, which is used in cbuildwheel > 2.23.2
# once default ref is updated, restriction can be removed
run: python3 -m pip install cibuildwheel==2.23.2
- name: Install build/test dependencies
working-directory: python
run: |
python3 -m pip install -r requirements-dev.txt
- name: Set default benchmark reference
run: echo "BENCHMARK_REF=142e45a2b941a1b603723c38882b193db1c1d968" >> $GITHUB_ENV
- name: Set benchmark reference if defined by workflow_dispatch
if: github.event.inputs.commit_ref != ''
run: echo "BENCHMARK_REF=${{ github.event.inputs.commit_ref }}" >> $GITHUB_ENV
- name: Benchmark old commit
uses: "./.github/actions/benchmark"
with:
ref: ${{ env.BENCHMARK_REF }}
compare: ""
# Head of repository is incompatible with cibuildwheel < 3.0.0 due to
# using the "test-sources" feature in pyproject.toml
- name: Update cibuildwheel for new commit
run: python3 -m pip install --upgrade cibuildwheel
- name: Benchmark current commit and compare
uses: "./.github/actions/benchmark"
with:
ref: ${{ github.sha }}