-
Notifications
You must be signed in to change notification settings - Fork 105
104 lines (88 loc) · 4.28 KB
/
test-measurements.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Test measurements
on:
schedule:
- cron: '10 21 * * *'
workflow_dispatch:
env:
RUSTUP_HOME: /tmp/rustup_home
CARGO_TERM_COLOR: always
TERM: xterm-256color
COUNT: 100
BINARYEN_VERSION: version_111
jobs:
build:
runs-on: [kuberunner]
timeout-minutes: 720
steps:
- name: "ACTIONS: Checkout"
uses: actions/checkout@v4
- name: "Install: Set cargo path"
run: echo "/tmp/cargo/bin" >> $GITHUB_PATH
- name: "Install: Rust toolchain"
uses: dsherret/rust-toolchain-file@v1
- name: "Show: Versioning"
run: ./scripts/gear.sh show
- name: "Install: Build deps"
run: |
sudo apt update
sudo apt install -y git clang curl libssl-dev llvm libudev-dev cmake protobuf-compiler wget bzip2
sudo wget -c https://github.com/WebAssembly/binaryen/releases/download/$BINARYEN_VERSION/binaryen-$BINARYEN_VERSION-x86_64-linux.tar.gz -O - | sudo tar -xz -C .
sudo cp binaryen-$BINARYEN_VERSION/bin/wasm-opt /usr/bin/
- name: "Build: Gear"
run: ./scripts/gear.sh build gear --release --locked --features=runtime-benchmarks
- name: "Collect: Gear workspace tests"
run: |
./scripts/gear.sh check_extensions
mkdir -p ./target/analysis/tests/
mkdir -p ./target/analysis/output/
cargo build --release --package regression-analysis
for i in `seq 1 $COUNT`; do echo $i; cargo nextest run --package pallet-* --profile ci --no-fail-fast --release -j1 > ./target/analysis/output/$i 2>&1 || { exit_code=$?; if [ x$exit_code != x0 ]; then cat ./target/analysis/output/$i; fi; exit $exit_code; }; mv ./target/nextest/ci/junit.xml ./target/analysis/tests/$i; done
./target/release/regression-analysis collect-data --data-folder-path ./target/analysis/tests/ --output-path ./target/pallet-tests.json
- name: "Generate report: Gear workspace tests"
run: >-
./target/release/regression-analysis convert
--data-folder-path ./target/analysis/tests/
--output-file ./target/action-pallet-output.json
- name: "Collect: pallet-gear benches"
run: >-
./target/release/gear benchmark pallet --pallet=pallet_gear
--steps=50
--repeat=20
--chain=dev
--extrinsic=*
--heap-pages=4096
--output ./target/weights.json
--template ./.maintain/regression-analysis-weight-template.hbs
- name: "Generate report: pallet-gear benches"
run: |
./target/release/regression-analysis weights --input-file ./target/weights.json --output-file ./target/action-hostfn-weights.json host-fn
./target/release/regression-analysis weights --input-file ./target/weights.json --output-file ./target/action-instruction-weights.json instruction
./target/release/regression-analysis weights --input-file ./target/weights.json --output-file ./target/action-extrinsic-weights.json extrinsic
- name: "Deploy: Gear workspace tests"
uses: ./.github/actions/deploy-benchmark
with:
name: Gear workspace tests
file: ./target/action-pallet-output.json
ssh-deploy-key: ${{ secrets.PERFORMANCE_CHARTS_DEPLOY_KEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: "Deploy: pallet-gear host function weights"
uses: ./.github/actions/deploy-benchmark
with:
name: pallet-gear host function weights
file: ./target/action-hostfn-weights.json
ssh-deploy-key: ${{ secrets.PERFORMANCE_CHARTS_DEPLOY_KEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: "Deploy: pallet-gear instruction weights"
uses: ./.github/actions/deploy-benchmark
with:
name: pallet-gear instruction weights
file: ./target/action-instruction-weights.json
ssh-deploy-key: ${{ secrets.PERFORMANCE_CHARTS_DEPLOY_KEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: "Deploy: pallet-gear extrinsic weights"
uses: ./.github/actions/deploy-benchmark
with:
name: pallet-gear extrinsic weights
file: ./target/action-extrinsic-weights.json
ssh-deploy-key: ${{ secrets.PERFORMANCE_CHARTS_DEPLOY_KEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}