forked from keep-starknet-strange/madara
-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (101 loc) · 3.12 KB
/
benchmarks.yml
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: Task - Benchmark
on:
workflow_dispatch:
workflow_call:
jobs:
benchmark:
runs-on: [self-hosted, linux, benchmark]
steps:
- uses: actions/checkout@v3
with:
clean: false
- name: Build tests and install benchmark projects
run: |-
cd tests
npm clean-install
npm run build
cd ../benchmarking
npm i
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key:
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{
github.run_id }}
fail-on-cache-miss: true
- name: Run benchmark
run: |
cd benchmarking
npm run test:ci
- name: Compare result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: "customBiggerIsBetter"
output-file-path: ./benchmarking/reports/metrics.json
alert-threshold: "120%"
github-token: ${{ secrets.GITHUB_TOKEN }}
fail-on-alert: true
summary-always: ${{ github.ref == 'refs/heads/main' }}
comment-always: false
comment-on-alert: false
auto-push: ${{ github.ref == 'refs/heads/main' }}
benchmark-with-state-root:
runs-on: [self-hosted, linux, benchmark]
steps:
- uses: actions/checkout@v3
with:
clean: false
- name: Build tests and install benchmark projects
run: |-
cd tests
npm clean-install
npm run build
cd ../benchmarking
npm i
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key:
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{
github.run_id }}
fail-on-cache-miss: true
restore-keys: |
${{ runner.os }}-cargo
- name: Setup rust toolchain
if: steps.cache.outputs.cache-hit != 'true'
run: rustup show
- name: Setup build deps
run: |
sudo apt-get update
sudo apt-get install -y clang llvm libudev-dev protobuf-compiler
- name: Build the project
run: |
cargo build --release --workspace
- name: Run benchmark
run: |
cd benchmarking
npm run test:ci-state-root:erc20
- name: Compare result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: "customBiggerIsBetter"
output-file-path: ./benchmarking/reports/metrics-state-root.json
alert-threshold: "120%"
github-token: ${{ secrets.GITHUB_TOKEN }}
fail-on-alert: true
summary-always: ${{ github.ref == 'refs/heads/main' }}
comment-always: false
comment-on-alert: false
benchmark-data-dir-path: "dev/bench-with-state-root"
auto-push: ${{ github.ref == 'refs/heads/main' }}