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 fa785b3
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/Bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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
BENCHER_ADAPTER: json
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: ${{ matrix.python-version }}

- name: Create virtual environment
run: |
python -m venv venv
- name: "Test Rust"
if: matrix.os == 'ubuntu-latest'
run: |
cargo test
- 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 }}" \
--err \
"pytest --benchmark-json results.json tests/test_bench.py"

0 comments on commit fa785b3

Please sign in to comment.