This repository has been archived by the owner on Jul 22, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 54
59 lines (56 loc) · 1.79 KB
/
run-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
name: Run Benchmark
on:
workflow_dispatch:
jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.9, pypy3]
exclude:
- os: windows-latest
python-version: pypy3
name: Benchmark on Python ${{ matrix.python-version }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -U pip
pip install tox tox-gh-actions
- name: Run benchmark with tox
run: |
tox
env:
PYTEST_ADDOPTS: '--benchmark-only --no-cov --benchmark-json=results_${{ matrix.os }}_${{ matrix.python-version }}.json'
- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: benchmark_result
path: results_${{ matrix.os }}_${{ matrix.python-version }}.json
comparison:
runs-on: ubuntu-latest
name: compare benchmark results
needs: run
steps:
- uses: actions/checkout@v2
- name: download artifact
uses: actions/download-artifact@v2
with:
name: benchmark_result
- name: setup python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: post result to issue
run: |
python -m pip install -U pip
python -m pip install -r utils/requirements.txt
python utils/github_comment_bench.py --repository ${GITHUB_REPOSITORY} --issue ${ISSUE_NUMBER} --runid ${GITHUB_RUN_ID} results_*.json
env:
ISSUE_NUMBER: 123
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}