From 3e019467e92ef237c1a3b54f8303bfa0173e19df Mon Sep 17 00:00:00 2001 From: Jan Ferdinand Sauer Date: Tue, 10 Dec 2024 18:33:24 +0100 Subject: [PATCH] ci: Enable continuous benchmarks through codspeed --- .github/workflows/codspeed.yml | 37 ++++++++++++++++++++++++++++++++++ Cargo.toml | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/codspeed.yml diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml new file mode 100644 index 00000000..1235c4c5 --- /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 65a92e27..0aea6e7b 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"] }