Skip to content

Commit

Permalink
try bencher
Browse files Browse the repository at this point in the history
  • Loading branch information
ringsaturn committed Mar 21, 2024
1 parent 6cb28d5 commit 2810db1
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/Bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Bench

on:
push:
branches:
- main

jobs:
benchmark_with_bencher:
name: Continuous Benchmarking with Bencher
runs-on: ubuntu-latest
env:
BENCHER_PROJECT: tzfpy
BENCHER_TESTBED: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Create virtual environment
run: |
python -m venv venv
- uses: bencherdev/bencher@main

- name: Install tzfpy and test
shell: bash
run: |
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements_dev.txt
maturin develop --release --extras=pytz
pytest | tee benchmark_result.txt
bencher run \
--branch "$GITHUB_REF_NAME" \
--token "${{ secrets.BENCHER_API_TOKEN }}" \
--adapter python_pytest \
--err \
"pytest --benchmark-json results.json tests/test_bench.py"
4 changes: 4 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
- "*.*.*"
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
linux:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 2810db1

Please sign in to comment.