-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (58 loc) · 1.95 KB
/
ci.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
name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Check out pybm
uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Run pre-commit hooks
uses: pre-commit/[email protected]
example-tests:
runs-on: ubuntu-latest
strategy:
matrix:
example: [sum-example, sum-example-gbm]
steps:
- name: Check out pybm
uses: actions/checkout@v3
- name: Check out ${{ matrix.example }} repo
uses: actions/checkout@v3
with:
fetch-depth: 0
repository: nicholasjng/pybm-${{ matrix.example }}
path: ${{ matrix.example }}
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install pybm and other Python dependencies
run: |
python -m pip install .. wheel google-benchmark
working-directory: ${{ matrix.example }}
- name: Create virtual environment with the current pybm checkout
run: python -m venv venv --system-site-packages
working-directory: ${{ matrix.example }}
- name: Initialize pybm environment for use with Google Benchmark
if: ${{ matrix.example == 'sum-example-gbm' }}
run: pybm init -v -o runner.name=pybm.runners.GoogleBenchmarkRunner
working-directory: ${{ matrix.example }}
- name: Initialize pybm environment for use with timeit
if: ${{ matrix.example == 'sum-example' }}
run: pybm init -v
working-directory: ${{ matrix.example }}
- name: Run ${{matrix.example}} end-to-end test
run: |
pybm run -M benchmarks master linear-time constant-time --use-checkouts
pybm compare master linear-time constant-time
working-directory: ${{ matrix.example }}