-
Notifications
You must be signed in to change notification settings - Fork 66
122 lines (109 loc) · 4.49 KB
/
blockifier_ci.yml
File metadata and controls
122 lines (109 loc) · 4.49 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
name: Blockifier-CI
on:
pull_request:
types:
- opened
- reopened
- synchronize
- edited
paths:
- ".github/actions/bootstrap/action.yml"
- ".github/workflows/blockifier_ci.yml"
- ".github/workflows/upload_artifacts_workflow.yml"
- "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@v6
- 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@v6
- 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-large-ubuntu-24-04-amd64
steps:
- uses: actions/checkout@v6
- 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@v6
- 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-xlarge-ubuntu-24-04-amd64
if: ${{ github.event_name == 'pull_request' }}
steps:
# Checkout the base branch to benchmark the old code.
- uses: actions/checkout@v6
with:
ref: ${{ github.base_ref }}
- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Benchmark the base branch code.
- name: Benchmark (Base Branch)
run: cargo run -p bench_tools -- run --package blockifier --out /tmp/base_results
# Checkout the PR branch into a unique subdirectory to avoid overwriting
# the base branch's composite action files at the workspace root, and to
# avoid colliding with any repo folder (e.g. one named "pr").
- uses: actions/checkout@v6
with:
path: pr-${{ github.run_id }}
# Copy base branch Criterion baseline into PR dir so run-and-compare finds it.
- run: |
mkdir -p pr-${{ github.run_id }}/target
cp -r target/criterion pr-${{ github.run_id }}/target/
# Benchmark the current branch and compare to the previous run.
- name: Benchmark (Feature Branch)
working-directory: pr-${{ github.run_id }}
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}