-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (64 loc) · 2.06 KB
/
benchmark.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Benchmark
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
benchmark:
name: Check performance regression.
runs-on: ubuntu-latest
permissions:
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
disable-sudo: true
egress-policy: block
disable-telemetry: false
allowed-endpoints: >
files.pythonhosted.org:443
github.com:443
pypi.org:443
api.github.com:443
- name: Checkout main branch
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
clean: true
- name: Setup Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
with:
python-version: "3.11"
- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install UV
run: |
pipx install --pip-args=--constraint=.github/workflows/constraints.txt uv
uv --version
- name: Install Nox
run: |
uvx pipx install --pip-args=--constraint=.github/workflows/constraints.txt nox
nox --version
- name: Run benchmark with nox
env:
UV_PREVIEW: 1
run: nox -s benchmark
- name: Store benchmark result in github.io
uses: benchmark-action/github-action-benchmark@d48d326b4ca9ba73ca0cd0d59f108f9e02a381c7 # tag=v1
with:
name: Pytest-Benchmark Benchmark
tool: "pytest"
output-file-path: benchmark-output.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
alert-threshold: "130%"
comment-on-alert: true
fail-on-alert: true