2023-08-29 06:26:36 +00:00
|
|
|
name: benches
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- "main"
|
|
|
|
pull_request:
|
|
|
|
# `workflow_dispatch` allows CodSpeed to trigger backtest
|
|
|
|
# performance analysis in order to generate initial data.
|
|
|
|
workflow_dispatch:
|
|
|
|
|
2024-02-19 22:14:00 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}-benches
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2023-08-29 06:26:36 +00:00
|
|
|
jobs:
|
|
|
|
benchmarks:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-10-23 20:32:16 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-12-11 20:04:18 +00:00
|
|
|
- uses: actions/setup-python@v5
|
2023-08-29 06:26:36 +00:00
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
2023-11-14 19:09:45 +00:00
|
|
|
with:
|
|
|
|
components: rust-src
|
2023-08-29 06:26:36 +00:00
|
|
|
|
2024-01-22 20:07:15 +00:00
|
|
|
- uses: actions/cache@v4
|
2023-08-29 06:26:36 +00:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/registry
|
|
|
|
~/.cargo/git
|
|
|
|
pyo3-benches/target
|
|
|
|
target
|
|
|
|
key: cargo-${{ runner.os }}-bench-${{ hashFiles('**/Cargo.toml') }}
|
|
|
|
continue-on-error: true
|
|
|
|
|
|
|
|
- name: Install cargo-codspeed
|
|
|
|
run: cargo install cargo-codspeed
|
|
|
|
|
|
|
|
- name: Install nox
|
|
|
|
run: pip install nox
|
|
|
|
|
|
|
|
- name: Run the benchmarks
|
2023-12-04 19:03:56 +00:00
|
|
|
uses: CodSpeedHQ/action@v2
|
2023-08-29 06:26:36 +00:00
|
|
|
with:
|
|
|
|
run: nox -s codspeed
|
|
|
|
token: ${{ secrets.CODSPEED_TOKEN }}
|