-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (54 loc) · 1.81 KB
/
Copy pathbenchmark.yml
File metadata and controls
67 lines (54 loc) · 1.81 KB
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
---
name: Benchmark Python Performance
on:
workflow_dispatch:
jobs:
benchmark:
name: Run benchmark for ${{ matrix.image }}
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}
strategy:
matrix:
include:
- image: ndunnett/python:latest
name: ndunnett
- image: python:latest
name: official
steps:
- name: Install PyPerformance
run: python -m pip install pyperformance
- name: Run benchmark
run: pyperformance run --output ${{ matrix.name }}.json --rigorous && exit 0 || exit 0
- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}-result
path: ${{ matrix.name }}.json
compare:
name: Compare benchmark results
runs-on: ubuntu-latest
needs: benchmark
steps:
- uses: actions/checkout@v4
- name: Download benchmark results
uses: actions/download-artifact@v4
with:
path: results
merge-multiple: true
- name: Install PyPerformance
run: python3 -m pip install pyperformance
- name: Run comparison
run: echo "$(pyperformance compare results/official.json results/ndunnett.json --output_style table)" > benchmark-comparison.txt
- name: Upload raw comparison
uses: actions/upload-artifact@v4
with:
name: benchmark-comparison
path: benchmark-comparison.txt
- name: Process PyPerformance output into Markdown
run: python3 ./.github/workflows/scripts/format_benchmark.py benchmark-comparison.txt
- name: Commit and push benchmark comparsion
run: |
git config --global user.email "benchmark-bot@example.com"
git config --global user.name "benchmark-bot"
git commit -am "Updated BENCHMARK.md" && git push || exit 0