try adding codspeed benchmarks #1
Workflow file for this run
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: | |
- "main" | |
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@v3 | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
pyo3-benchmarks/target | |
key: cargo-${{ runner.os }}-bench-${{ hashFiles('**/Cargo.toml') }} | |
continue-on-error: true | |
- name: Build the Rust benchmarks | |
run: cargo codspeed build | |
working-directory: pyo3-benchmarks | |
- name: Build the Python benchmarks | |
run: pip install -r requirements-dev.txt pytest-codspeed . | |
working-directory: pytests | |
- name: Run the Python benchmarks | |
uses: CodSpeedHQ/action@v1 | |
with: | |
run: | |
cargo codspeed run | |
cd ../pytests && pytest --codspeed | |
token: ${{ secrets.CODSPEED_TOKEN }} | |
working-directory: pyo3-benchmarks |