Skip to content

Commit 5540b54

Browse files
authored
fix benchmark script no_build (#2637)
# Goal The goal of this PR is to fix the CI issue happening in [here](https://github.com/frequency-chain/frequency/actions/runs/19147363545/job/54730278841) Related to #2601
1 parent 3560d10 commit 5540b54

File tree

5 files changed

+24
-7
lines changed

5 files changed

+24
-7
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Global rule
2-
* @wilwade
2+
* @aramikm @shannonwells
33

44
# GitHub Workflows and Templates
55
.github/** @demisx

.github/issues/dependabot-alert.template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "{{env.PR_TITLE}}"
33
labels: technical debt, dependencies, security
4-
assignees: demisx, wilwade
4+
assignees: demisx, aramikm, shannonwells
55
---
66

77
The dependabot alert has detected that this repository uses a vulnerable dependency or malware and created new PR {{env.PR_URL}}.

.github/workflows/benchmarks-run.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ jobs:
3838
uses: actions/upload-artifact@v4
3939
with:
4040
name: benchmark-binary
41-
path: target/release/frequency
41+
path: |
42+
target/release/frequency
43+
target/release/benchmark_transform
4244
retention-days: 3
4345

4446
- name: Upload WASM Build Artifacts
@@ -84,7 +86,9 @@ jobs:
8486
path: target/release/wbuild
8587

8688
- name: Make Binary Executable
87-
run: chmod +x target/release/frequency
89+
run: |
90+
chmod +x target/release/frequency
91+
chmod +x target/release/benchmark_transform
8892
8993
- name: Update Weights
9094
run: |

.github/workflows/release.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ jobs:
9494
uses: actions/upload-artifact@v4
9595
with:
9696
name: benchmark-binary
97-
path: target/release/frequency
97+
path: |
98+
target/release/frequency
99+
target/release/benchmark_transform
98100
retention-days: 3
99101

100102
- name: Upload WASM Build Artifacts
@@ -134,7 +136,9 @@ jobs:
134136
path: target/release/wbuild
135137

136138
- name: Make Binary Executable
137-
run: chmod +x target/release/frequency
139+
run: |
140+
chmod +x target/release/frequency
141+
chmod +x target/release/benchmark_transform
138142
139143
- name: Update Weights for All Pallets
140144
run: |

scripts/run_benchmarks.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ fi
193193
RUST_LOG="info"
194194
RUNTIME=${PROJECT}/target/${PROFILE_DIR}/frequency
195195
BENCHMARK="${RUNTIME} benchmark "
196+
BENCHMARK_TRANSFORM_BIN=${PROJECT}/target/${PROFILE_DIR}/benchmark_transform
196197

197198
if [[ ${build_only} == false ]]; then
198199
echo "Running benchmarks for the following pallets:\
@@ -234,7 +235,11 @@ function run_benchmark() {
234235

235236
if [[ ${1} == "pallet_stateful-storage" ]]; then
236237
STATEFUL_LOCATION=${PROJECT}/pallets/stateful-storage/src/weights.rs
237-
cargo run -p benchmark_transform -- ${STATEFUL_LOCATION} ${STATEFUL_LOCATION} || exit_err
238+
if [[ ${skip_build} == false ]]; then
239+
cargo run -p benchmark_transform -- ${STATEFUL_LOCATION} ${STATEFUL_LOCATION} || exit_err
240+
else
241+
${BENCHMARK_TRANSFORM_BIN} ${STATEFUL_LOCATION} ${STATEFUL_LOCATION} || exit_err
242+
fi
238243
fi
239244
}
240245

@@ -244,6 +249,10 @@ then
244249
echo ${CMD}
245250
${CMD} || exit_err
246251

252+
CMD_TRANSFORM="cargo build -p benchmark_transform --profile=${PROFILE}"
253+
echo ${CMD_TRANSFORM}
254+
${CMD_TRANSFORM} || exit_err
255+
247256
if [[ ${build_only} == true ]]; then
248257
echo "Build complete. Exiting as requested."
249258
exit 0

0 commit comments

Comments
 (0)