-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (58 loc) · 1.81 KB
/
benchmark.yml
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
name: benchmark
# Triggers the workflow on push to the pullrequest-token branches, and to main
on:
workflow_dispatch:
push:
branches: [ main]
pull_request:
branches: [ main ]
env:
UV_SYSTEM_PYTHON: true
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
# Check out repo and set up Python
- name: Check out the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
# Setup python
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install package
run: |
uv pip install ".[dev]"
# Run benchmarks
- name: Run benchmarks on python 3.10
run: |
pytest --full-trace --show-capture=no -sv benchmarks/benchmark_*.py
- name: Obtain git status
id: status
run: |
exec 5>&1
STATUS=$(git status|tee >(cat - >&5))
echo "STATUS<<EOF" >> $GITHUB_OUTPUT
echo "$STATUS" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
# create pull request if necessary
- name: "Create Pull Request"
uses: peter-evans/create-pull-request@v6
if: ${{ contains(steps.status.outputs.STATUS, 'benchmark_targets.yaml')}}
with:
token: ${{ steps.generate-token.outputs.token }}
commit-message: Update benchmark targets
title: "Update benchmark targets"
branch: "update_benchmark_targets"
body: |
Generated new benchmark targets.