-
Notifications
You must be signed in to change notification settings - Fork 119
126 lines (126 loc) · 4.51 KB
/
benchmark_tests.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Run Benchmark Tests
on:
pull_request:
branches: [manta]
types: [opened, reopened, synchronize, labeled]
push:
branches: [manta]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
DEBIAN_FRONTEND: noninteractive
jobs:
start-benchmark-checks:
timeout-minutes: 180
runs-on: runtime
if: contains(github.event.pull_request.labels.*.name, 'A-benchmark-checks')
container:
image: ubuntu:20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 18
- name: install sccache
env:
SCCACHE_RELEASE_URL: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: v0.5.3
run: |
apt update
apt install -y curl wget
npm install -g yarn && node --version && node --version && npm --version && yarn --version
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl
mkdir -p $HOME/.local/bin
curl -L "$SCCACHE_RELEASE_URL/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz
mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache
chmod +x $HOME/.local/bin/sccache
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: cache sccache
uses: actions/cache@v2
continue-on-error: false
with:
path: ~/.cache/sccache
key: sccache-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
sccache-
- name: start sccache server
run: sccache --start-server
- name: rust setup
shell: bash
env:
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
# SCCACHE_CACHE_SIZE: 120G
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: ~/.cache/sccache
CARGO_TERM_COLOR: always
run: |
apt update
apt install -y pkg-config libssl-dev protobuf-compiler curl build-essential clang git
protoc --version
curl -s https://sh.rustup.rs -sSf | sh -s -- -y
source ${HOME}/.cargo/env
rustup toolchain install 1.74.0
rustup default 1.74.0
rustup target add wasm32-unknown-unknown
- name: cache cargo
uses: Swatinem/rust-cache@v2
- name: build benchmarking binary
run: |
RUSTC_BOOTSTRAP=1 cargo build --release --features runtime-benchmarks --timings
- name: create-calamari-chainspec
run: |
$GITHUB_WORKSPACE/target/release/manta build-spec --chain calamari-dev --disable-default-bootnode --raw > $GITHUB_WORKSPACE/tests/data/fork.json
- name: append manta-pay storage for Calamari
run: |
wget -P $GITHUB_WORKSPACE/tests/data https://manta-ops.s3.amazonaws.com/integration-tests-data/storage.json
cd $GITHUB_WORKSPACE/tests
yarn install
yarn
node append_storage.js calamari
- name: Run live benchmarks test
env:
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
# SCCACHE_CACHE_SIZE: 120G
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: ~/.cache/sccache
run: |
$GITHUB_WORKSPACE/target/release/manta \
benchmark \
pallet \
--chain=$GITHUB_WORKSPACE/tests/data/fork.json \
--pallet=* \
--extrinsic=* \
--repeat=1 \
--steps=2
- name: create-manta-dev-chainspec
run: |
$GITHUB_WORKSPACE/target/release/manta build-spec --chain manta-dev --disable-default-bootnode --raw > $GITHUB_WORKSPACE/tests/data/fork.json
- name: append manta-pay storage for Manta
run: |
wget -P $GITHUB_WORKSPACE/tests/data https://manta-ops.s3.amazonaws.com/integration-tests-data/storage.json
cd $GITHUB_WORKSPACE/tests
yarn install
yarn
node append_storage.js
- name: Run live benchmarks test
env:
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
# SCCACHE_CACHE_SIZE: 120G
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: ~/.cache/sccache
run: |
$GITHUB_WORKSPACE/target/release/manta \
benchmark \
pallet \
--chain=$GITHUB_WORKSPACE/tests/data/fork.json \
--pallet=* \
--extrinsic=* \
--repeat=1 \
--steps=2
- name: stop sccache server
run: sccache --stop-server || true