-
Notifications
You must be signed in to change notification settings - Fork 13
107 lines (103 loc) · 3.42 KB
/
benchmarking.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
105
106
107
name: Benchmarking
on:
push:
branches:
# Long living branches
- main
- dynamic_link
- /^[0-9]+\.[0-9]+$/
# 👇Add your branch here if benchmarking matters to your work
pull_request:
jobs:
benchmarking:
name: benchmarking
runs-on: ubuntu-latest
needs: [package_vm, package_crypto]
env:
RUST_BACKTRACE: 1
working-directory: ./packages/
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.60.0
target: wasm32-unknown-unknown
profile: minimal
override: true
- name: Cache cargo
uses: actions/cache@v3
with:
path: ~/.cargo
key: cargocache-v2-benchmarking-rust:1.60.0-{{ checksum "Cargo.lock" }}
- name: Version information
run: rustc --version; cargo --version; rustup --version; rustup target list --installed
- name: Run vm benchmarks (Singlepass)
working-directory: ${{env.working-directory}}/vm
run: cargo bench --no-default-features --features bench -- --color never --save-baseline singlepass
- name: Run crypto benchmarks
working-directory: ${{env.working-directory}}/crypto
run: cargo bench -- --color never --save-baseline crypto
package_crypto:
name: package_crypto
runs-on: ubuntu-latest
env:
working-directory: ./packages/crypto
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.60.0
target: wasm32-unknown-unknown
profile: minimal
override: true
- name: Cache cargo
uses: actions/cache@v3
with:
path: ~/.cargo
key: cargocache-v2-package_crypto-rust:1.60.0-${{ hashFiles('Cargo.lock') }}
- name: Version information
run: rustc --version; cargo --version; rustup --version; rustup target list --installed
- name: Build
working-directory: ${{env.working-directory}}
run: cargo build --locked
- name: Run tests
working-directory: ${{env.working-directory}}
run: cargo test --locked
package_vm:
name: package_vm
runs-on: ubuntu-latest
env:
working-directory: ./packages/vm
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.60.0
target: wasm32-unknown-unknown
profile: minimal
override: true
- name: Cache cargo
uses: actions/cache@v3
with:
path: ~/.cargo
key: cargocache-v2-package_vm-rust:1.60.0-${{ hashFiles('Cargo.lock') }}
- name: Version information
run: rustc --version; cargo --version; rustup --version; rustup target list --installed
- name: Build
working-directory: ${{env.working-directory}}
run: cargo build --locked
- name: Build with all features
working-directory: ${{env.working-directory}}
run: cargo build --locked --features iterator,staking,stargate
- name: Test
working-directory: ${{env.working-directory}}
run: cargo test --locked
- name: Test with all features
working-directory: ${{env.working-directory}}
run: cargo test --locked --features iterator,staking,stargate