-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6cb28d5
commit 70f9bbb
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
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
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 | ||
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: 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 }}" \ | ||
--err \ | ||
"pytest --benchmark-json results.json tests/test_bench.py" |
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