zizmor/.github/workflows/benchmark-pr-1p.yml
dependabot[bot] bf4bf9e0ae
Some checks are pending
Benchmark baseline / Continuous Benchmarking with Bencher (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Test (push) Waiting to run
CI / Test site build (push) Waiting to run
CI / All tests pass (push) Blocked by required conditions
zizmor wheel builds for PyPI 🐍 / Build Linux wheels (manylinux) (push) Waiting to run
zizmor wheel builds for PyPI 🐍 / Build Linux wheels (musllinux) (push) Waiting to run
zizmor wheel builds for PyPI 🐍 / Build Windows wheels (push) Waiting to run
zizmor wheel builds for PyPI 🐍 / Build macOS wheels (push) Waiting to run
zizmor wheel builds for PyPI 🐍 / Build source distribution (push) Waiting to run
zizmor wheel builds for PyPI 🐍 / Release (push) Blocked by required conditions
Deploy zizmor documentation site 🌐 / Deploy zizmor documentation to GitHub Pages 🌐 (push) Waiting to run
GitHub Actions Security Analysis with zizmor 🌈 / Run zizmor 🌈 (push) Waiting to run
chore(deps): bump the github-actions group with 6 updates (#1096)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-18 14:59:00 -04:00

79 lines
2.5 KiB
YAML

# benchmark-pr-1p.yml: submit benchmarks to Bencher.
#
# This workflow covers "first party" pull requests specifically,
# i.e. those created from branches within the same repository.
name: Benchmark PRs (first-party)
on:
pull_request:
types: [opened, reopened, edited, synchronize]
permissions: {}
concurrency:
group: "benchmark-pr-1p-${{ github.event.pull_request.number }}"
cancel-in-progress: true
jobs:
benchmark-pr-1p:
name: Continuous Benchmarking PRs with Bencher
runs-on: ubuntu-latest
if: >-
${{
github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name == github.repository
&& !contains(github.event.pull_request.labels.*.name, 'no-benchmark')
}}
permissions:
pull-requests: write
environment:
name: bencher
url: https://bencher.dev/console/projects/zizmor
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Set up Bencher
uses: bencherdev/bencher@e0bb2f0dcd5ae8446994d15536c902b289eeda17 # v0.5.4
- name: Installer hyperfine
run: |
sudo apt-get remove --purge man-db
sudo apt install -y hyperfine
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
- uses: astral-sh/setup-uv@d9e0f98d3fc6adb07d1e3d37f3043649ddad06a1 # v6.5.0
# TODO: use actions/cache to cache the plan phase here.
- name: Run benchmarks
run: make bench
- name: Upload benchmark results
# Take each result file in bench/results/*.json and use
# `bencher run` to upload it.
run: |
for file in bench/results/*.json; do
bencher run \
--project zizmor \
--token "${BENCHER_API_TOKEN}" \
--branch "${GITHUB_HEAD_REF}" \
--start-point "${GITHUB_BASE_REF}" \
--start-point-hash "${PULL_REQUEST_BASE_SHA}" \
--start-point-clone-thresholds \
--start-point-reset \
--testbed ubuntu-latest \
--err \
--adapter shell_hyperfine \
--github-actions "${GITHUB_TOKEN}" \
--file "${file}"
done
env:
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}