diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml new file mode 100644 index 000000000..1235c4c5f --- /dev/null +++ b/.github/workflows/codspeed.yml @@ -0,0 +1,37 @@ +name: CodSpeed + +on: + push: + branches: + - master + pull_request: + branches: + - master + # `workflow_dispatch` allows CodSpeed to trigger backtest + # performance analysis in order to generate initial data. + workflow_dispatch: + +jobs: + benchmarks: + name: Run benchmarks + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install stable toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Install codspeed + uses: taiki-e/install-action@v2 + with: + tool: cargo-codspeed + + - name: Build benchmarks + run: cargo codspeed build + + - name: Run benchmarks + uses: CodSpeedHQ/action@v3 + with: + run: cargo codspeed run + token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/Cargo.toml b/Cargo.toml index 65a92e276..0aea6e7b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,7 +61,7 @@ arbitrary = { version = "1", features = ["derive"] } assert2 = "0.3" colored = "2.1" clap = { version = "4", features = ["derive", "cargo", "wrap_help", "unicode", "string"] } -criterion = { version = "0.5", features = ["html_reports"] } +criterion = { package = "codspeed-criterion-compat", version = "2.7", features = ["html_reports"] } directories = "5" fs-err = "3.0" get-size2 = { version = "0.1.2", features = ["derive"] }