From 8118f96b141ae1c21b55c020bdd41bd1bd6b9ede Mon Sep 17 00:00:00 2001 From: Luiz Irber Date: Sat, 29 Jun 2024 16:09:31 -0700 Subject: [PATCH] enable codspeed --- .github/workflows/codspeed.yml | 34 ++++++++++++++++++++++++++++++++++ flake.nix | 1 + 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/codspeed.yml diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml new file mode 100644 index 000000000..43ee8dabb --- /dev/null +++ b/.github/workflows/codspeed.yml @@ -0,0 +1,34 @@ +name: codspeed-benchmarks + +on: + # Run on pushes to the main branch + push: + branches: + - "latest" + # Run on pull requests + 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 + + - name: Setup rust toolchain, cache and cargo-codspeed binary + uses: moonrepo/setup-rust@v0 + with: + channel: stable + cache-target: release + bins: cargo-codspeed + + - name: Build the benchmark target(s) + run: cargo codspeed build -p sourmash + + - name: Run the benchmarks + uses: CodSpeedHQ/action@v2 + with: + run: "cd src/core && cargo codspeed run" + token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/flake.nix b/flake.nix index 5a71fad66..046ea4730 100644 --- a/flake.nix +++ b/flake.nix @@ -129,6 +129,7 @@ cargo-udeps cargo-deny cargo-wasi + cargo-codspeed #cargo-semver-checks nixpkgs-fmt ];