chore: add additional benchmarks #14
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: benchmarks | |
on: | |
push: | |
branches: | |
- "master" | |
pull_request: | |
# `workflow_dispatch` allows CodSpeed to trigger backtest | |
# performance analysis in order to generate initial data. | |
workflow_dispatch: | |
jobs: | |
benchmarks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry==1.3.0 | |
poetry install | |
- name: Setup Rust part of the project | |
run: | | |
poetry run maturin build --release --out dist | |
pip install --no-index --find-links=dist/ rustberry | |
- name: Setup Benchmarks | |
working-directory: test_parser | |
run: | | |
poetry export --with test --with dev --without-hashes --without local --output requirements.txt | |
cat requirements.txt | |
pip install -r requirements.txt | |
- name: Run benchmarks | |
uses: CodSpeedHQ/action@v2 | |
with: | |
working-directory: test_parser | |
token: ${{ secrets.CODSPEED_TOKEN }} | |
run: pytest benchmarks --codspeed |