diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml new file mode 100644 index 0000000000..6be23dff27 --- /dev/null +++ b/.github/workflows/benchmarks.yml @@ -0,0 +1,40 @@ +name: Benchmark CI + +on: + push: + branches: + - master + +jobs: + # Job to run change detection + changes: + runs-on: core + permissions: + pull-requests: read + outputs: + run-ci: ${{ steps.filter.outputs.run-ci }} + steps: + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + run-ci: + - 'rusk/**/* + - 'node/**/* + predicate-quantifier: "any" + + benchmark: + needs: changes + if: needs.changes.outputs.run-ci == 'true' + name: Run Benchmarks + runs-on: core + steps: + - uses: actions/checkout@v4 + - uses: dsherret/rust-toolchain-file@v1 + - run: make bench + - name: Upload Benchmark Results + uses: actions/upload-artifact@v4 + with: + name: rusk-benchmark-results + path: ./target/criterion + retention-days: 14 diff --git a/.github/workflows/rusk_ci.yml b/.github/workflows/rusk_ci.yml index 0fa791b40f..ac2ed31cc9 100644 --- a/.github/workflows/rusk_ci.yml +++ b/.github/workflows/rusk_ci.yml @@ -76,18 +76,3 @@ jobs: - uses: actions/checkout@v4 - uses: dsherret/rust-toolchain-file@v1 - run: cargo fmt --all -- --check - benchmark: - needs: changes - if: needs.changes.outputs.run-ci == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/master' - name: Run Benchmarks - runs-on: core - steps: - - uses: actions/checkout@v4 - - uses: dsherret/rust-toolchain-file@v1 - - run: make bench - - name: Upload Benchmark Results - uses: actions/upload-artifact@v4 - with: - name: rusk-benchmark-results - path: ./target/criterion - retention-days: 14 diff --git a/Makefile b/Makefile index 4877216e23..a7bd6fdd66 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,8 @@ doc: ## Run doc gen $(MAKE) -C ./rusk-recovery $@ $(MAKE) -C ./wallet-core/ $@ -bench: keys wasm ## Bench Rusk +bench: keys wasm ## Bench Rusk & node + $(MAKE) -C ./node bench $(MAKE) -C ./rusk bench run: keys state web-wallet ## Run the server diff --git a/node/Makefile b/node/Makefile index 1a071c0c11..0d514b19fd 100644 --- a/node/Makefile +++ b/node/Makefile @@ -7,6 +7,12 @@ test: ## Run Node tests binary: ## Build a binary @cargo b --release --bin rusk-node +build-bench: ## Build the benchmarks + @cargo bench --no-run + +bench: ## Run the benchmarks + @cargo bench + debug_with_telemetry: # Build a binary with telemetry enabled. Currently, telemetry is only based on tokio_console cargo --config 'build.rustflags = ["--cfg", "tokio_unstable"]' build --features with_telemetry --bin rusk-node