Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Prev Previous commit
Next Next commit
divide build and bench
  • Loading branch information
alvicsam committed Mar 23, 2022
commit 5c4cec849ae626653ba2954d07e001cc055be891
31 changes: 30 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,42 @@ default:

#### stage: stage1

short_benchmark:
build_short_benchmark:
stage: stage1
<<: *test-refs
<<: *docker-env
<<: *collect-artifacts
script:
- cargo +nightly build --profile release --locked --features=runtime-benchmarks
- mkdir artifacts
- cp $CARGO_TARGET_DIR/release/polkadot ./artifacts/

short_benchmark_polkadot:
stage: stage2
<<: *test-refs
variables:
RUNTIME: polkadot
script:
- ./scripts/run_short_benches_for_runtime.sh $RUNTIME
tags:
- weights

short_benchmark_kusama:
stage: stage2
<<: *test-refs
variables:
RUNTIME: kusama
script:
- ./scripts/run_short_benches_for_runtime.sh $RUNTIME
tags:
- weights

short_benchmark_westend:
stage: stage2
<<: *test-refs
variables:
RUNTIME: westend
script:
- ./scripts/run_short_benches_for_runtime.sh $RUNTIME
tags:
- weights
4 changes: 2 additions & 2 deletions scripts/run_short_benches_for_runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ echo "[+] Running all benchmarks for $runtime"

cargo +nightly build --profile release --locked --features=runtime-benchmarks

./target/release/polkadot benchmark \
./artifacts/polkadot benchmark \
--chain "${runtime}-dev" \
--list |\
tail -n+2 |\
Expand All @@ -25,7 +25,7 @@ while read -r line; do
pallet="$(echo "$line" | cut -d' ' -f1)";
echo "Runtime: $runtime. Pallet: $pallet";
# '!' has the side effect of bypassing errexit / set -e
! ./target/release/polkadot benchmark \
! ./artifacts/polkadot benchmark \
--chain="${runtime}-dev" \
--steps=1 \
--repeat=1 \
Expand Down