-
Notifications
You must be signed in to change notification settings - Fork 66
133 lines (119 loc) · 4.81 KB
/
blockifier_ci.yml
File metadata and controls
133 lines (119 loc) · 4.81 KB
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
127
128
129
130
131
132
133
name: Blockifier-CI
# TODO(Dori, 15/8/2024): Split this job, so the feature-less build doesn't run on every push to main
# branches.
on:
push:
branches:
- main
- main-v[0-9].**
tags:
- v[0-9].**
# TODO(Dori, 1/9/2024): Decide when exactly native-blockifier artifacts will be built. Until
# then, keep the 'paths' key empty and build on every push to a release branch / tag.
pull_request:
types:
- opened
- reopened
- synchronize
paths:
# Other than code-related changes, all changes related to the native-blockifier build-and-push
# process should trigger the build (e.g., changes to the Dockerfile, build scripts, etc.).
- ".github/actions/bootstrap/action.yml"
- ".github/workflows/blockifier_ci.yml"
- ".github/workflows/upload_artifacts_workflow.yml"
- "build_native_in_docker.sh"
- "Cargo.lock"
- "Cargo.toml"
- "crates/blockifier/**"
- "crates/blockifier_test_utils/**"
- "crates/native_blockifier/**"
- "crates/apollo_sierra_multicompile/build.rs"
- "scripts/build_native_blockifier.sh"
- "scripts/dependencies.sh"
- "scripts/install_build_tools.sh"
- "scripts/sequencer-ci.Dockerfile"
env:
RUSTFLAGS: "-D warnings"
TRANSFERS_BENCHMARK_CAIRO_NATIVE_TIME_LIMIT_NS: "200000000"
TRANSFERS_BENCHMARK_VM_TIME_LIMIT_NS: "1000000000"
# On PR events, cancel existing CI runs on this same PR for this workflow.
# Also, create different concurrency groups for different pushed commits, on push events.
concurrency:
group: >
${{ github.workflow }}-
${{ github.ref }}-
${{ github.event_name == 'pull_request' && 'PR' || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
test-without-features:
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# No features - build blockifier without features activated by dependencies in the workspace.
- run: cargo test -p blockifier
- run: cargo build -p blockifier
test-with-transaction-serde-feature:
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# transaction_serde is not activated by any workspace crate; test the build.
- run: cargo test -p blockifier --features transaction_serde
- run: cargo build -p blockifier --features transaction_serde
test-with-cairo-native-feature:
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# cairo_native is not activated by any workspace crate; test the build.
- run: cargo build -p blockifier --features cairo_native
- run: cargo test -p blockifier --features cairo_native
test-with-tracing-feature:
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# tracing is not activated by any workspace crate; test the build.
- run: cargo build -p blockifier --features tracing
- run: cargo test -p blockifier --features tracing
benchmarking:
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
if: ${{ github.event_name == 'pull_request' }}
steps:
# Checkout the base branch to benchmark the old code.
- uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Restore cargo artifacts build cache.
- name: Restore Cargo build cache
uses: Swatinem/rust-cache@v2
with:
shared-key: blockifier-bench
cache-on-failure: true
cache-workspace-crates: true
# Benchmark the base branch code.
- run: cargo run -p bench_tools -- run --package blockifier --out /tmp/base_results
# Checkout the current branch to benchmark the new code.
- uses: actions/checkout@v4
with:
clean: false
# Benchmark the current branch and compare to the previous run.
- run: |
cargo run -p bench_tools -- run-and-compare \
--package blockifier \
--out /tmp/new_results \
--regression-limit 8.0 \
--set-absolute-time-ns-limit transfers_benchmark_cairo_native ${TRANSFERS_BENCHMARK_CAIRO_NATIVE_TIME_LIMIT_NS} \
--set-absolute-time-ns-limit transfers_benchmark_vm ${TRANSFERS_BENCHMARK_VM_TIME_LIMIT_NS}