Skip to content

chore: update external product types reference #407

chore: update external product types reference

chore: update external product types reference #407

Workflow file for this run

name: Run benchmark
on:
pull_request:
permissions:
contents: read
pull-requests: write
jobs:
benchmark:
name: Performance regression check
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
with:
# Get history and tags for SCM versioning to work
fetch-depth: 0
- name: Install the latest version of uv with cache enabled
uses: astral-sh/setup-uv@v9.0.0
with:
version: "latest"
enable-cache: true
cache-dependency-glob: |
pyproject.toml
tox.ini
- name: Run benchmark on target branch and current ref, then compare
shell: bash
env:
TARGET_BRANCH: ${{ github.event.pull_request.base.ref }}
run: |
set -euo pipefail
CURRENT_SHA="$(git rev-parse HEAD)"
echo "Running benchmark on ${TARGET_BRANCH}"
git checkout --detach "origin/${TARGET_BRANCH}"
uvx --python 3.14 --with tox-uv tox -e benchmark -- --benchmark-json baseline.json
echo "Running benchmark on current ref"
git checkout --detach "${CURRENT_SHA}"
uvx --python 3.14 --with tox-uv tox -e benchmark -- --benchmark-json candidate.json
echo "Comparing benchmark results"
uvx --python 3.14 \
--with "pytest-benchmark @ git+https://github.com/ionelmc/pytest-benchmark.git@master" \
pytest-benchmark compare --between=median \
baseline.json candidate.json \
| tee benchmark-compare.txt
{
echo "## Benchmark comparison"
echo
echo "Compared baseline: \`origin/${TARGET_BRANCH}\`"
echo "Compared candidate: ${CURRENT_SHA}"
echo
echo '```text'
cat benchmark-compare.txt
echo '```'
} > benchmark-comment.md
- name: Publish benchmark comparison comment
if: github.event.pull_request.head.repo.full_name == github.repository
uses: marocchino/sticky-pull-request-comment@v2
with:
header: benchmark-comparison
path: benchmark-comment.md