diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index eed2eed..70052a8 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -29,8 +29,13 @@ jobs: channel: stable cache-target: release + - name: Build benchmarks + run: make benchmark-build + env: + CODSPEED_RUNNER_MODE: ${{ vars.CODSPEED_MODE }} # Set by the CodSpeed action for benchmark-run + - name: Run benchmarks uses: CodSpeedHQ/action@78102a468f96d8e0ccb92d0ec49425753fc42062 # v5.6.0 with: mode: ${{ vars.CODSPEED_MODE }} - run: make benchmark + run: make benchmark-run diff --git a/Makefile b/Makefile index 37b512a..39342b0 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,13 @@ SDK_BENCHMARKS := benchmarks/fixtures/sdk-benchmarks $(SDK_BENCHMARKS)/environments: git submodule update --init -- $(SDK_BENCHMARKS) -.PHONY: benchmark -benchmark: | $(SDK_BENCHMARKS)/environments +.PHONY: benchmark benchmark-build benchmark-run +benchmark: benchmark-build benchmark-run + +# Kept apart from benchmark-run: CodSpeed's simulation mode runs its whole command under Valgrind +benchmark-build: | $(SDK_BENCHMARKS)/environments cargo install --locked cargo-codspeed@$(CARGO_CODSPEED_VERSION) cd benchmarks && cargo codspeed build --locked + +benchmark-run: | $(SDK_BENCHMARKS)/environments cd benchmarks && SDK_BENCHMARKS_ENVIRONMENTS=$(CURDIR)/$(SDK_BENCHMARKS)/environments cargo codspeed run