Run pre-commit autoupdate #104
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |