-
Notifications
You must be signed in to change notification settings - Fork 34
154 lines (147 loc) · 5.55 KB
/
ci.yml
File metadata and controls
154 lines (147 loc) · 5.55 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: CI
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
concurrency:
group: ${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
pre-commit:
name: pre-commit-${{ matrix.expand.name }}
runs-on: ${{ matrix.expand.runner }}
strategy:
fail-fast: false
matrix:
expand:
- runner: "ubuntu-arm64-2core-8gb"
name: "arm64"
- runner: "ubuntu-24.04"
name: "x86_64"
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
- name: Install nightly toolchain for rustfmt
run: rustup toolchain install nightly-2025-08-11 --component rustfmt
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Run pre-commit
uses: pre-commit/action@v3.0.1
env:
SKIP: "clippy"
rust-checks:
name: rust-checks-${{ matrix.expand.name }}
runs-on: ${{ matrix.expand.runner }}
strategy:
fail-fast: false
matrix:
expand:
- runner: "ubuntu-arm64-2core-8gb"
name: "arm64"
- runner: "ubuntu-24.04"
name: "x86_64"
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
- name: Run clippy (all-features)
run: cargo clippy --all --all-features --tests --benches --examples -- -D warnings
env:
RUSTFLAGS: "-C target-cpu=native"
rust-tests:
name: rust-${{ matrix.test.name }}-${{ matrix.machine.name }}
runs-on: ${{ matrix.machine.runner }}
# Skip draft PRs to save costs, except for Graphite merge queue PRs (branch prefix: gtmq_)
# Graphite MQ docs: https://graphite.dev/docs/graphite-merge-queue
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || startsWith(github.head_ref, 'gtmq_')
strategy:
fail-fast: false
matrix:
machine:
- runner: "m8g-2xlarge"
name: "arm64"
- runner: "m7i-2xlarge"
name: "x86_64"
test:
- name: "test"
command: "cargo nextest run --workspace --release --no-fail-fast"
rustflags: "-C debug-assertions"
- name: "test-all-features"
command: |
ALL_FEATURES_WO_BAIL_PANIC=$(.github/scripts/get-features-without-bail-panic.sh | tail -1)
echo "ALL_FEATURES_WO_BAIL_PANIC: $ALL_FEATURES_WO_BAIL_PANIC"
cargo nextest run --workspace --release --features "$ALL_FEATURES_WO_BAIL_PANIC" --no-fail-fast
rustflags: "-C debug-assertions"
- name: "wasm-build"
command: |
cargo build -p binius-math -p binius-field -p binius-prover -p binius-verifier --target wasm32-wasip1 --tests --benches
rust-target: "wasm32-wasip1"
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install deps
run: sudo yum -y install gcc openssl-devel curl jq z3-devel clang pkg-config
- name: Install cargo-nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: ${{ matrix.test.rust-target || '' }}
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.machine.name }}-${{ matrix.test.name }}
cache-on-failure: true
- name: Run platform diagnostics
run: cargo test -p binius-utils --features platform-diagnostics test_platform_diagnostics -- --nocapture
- name: Run platform diagnostics (target-cpu=native)
run: cargo test -p binius-utils --features platform-diagnostics test_platform_diagnostics -- --nocapture
env:
RUSTFLAGS: "-C target-cpu=native"
- name: Run command
run: ${{ matrix.test.command }}
env:
RUSTFLAGS: ${{ matrix.test.rustflags || '' }}
# Seems like z3-devel pkg-config config is broken and has wrong path to include files.
# This was fixed upstream but the fix seems to be not available in the present CI
# environment. Therefore, we workaround this by overriding the env flags manually.
Z3_SYS_Z3_HEADER: /usr/include/z3/z3.h
CFLAGS: -I/usr/include/z3
LDFLAGS: -L/usr/lib64 -lz3
rust-doc:
name: rust-doc
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Build documentation (including private items for CI checks)
run: cargo doc --document-private-items --no-deps
circuits-snapshot:
name: circuits-snapshot (${{ matrix.example }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example: [ethsign, zklogin, sha256, sha512, keccak, hash_based_sig]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Check ${{ matrix.example }} circuit statistics snapshot
run: cargo run --example ${{ matrix.example }} --release -- check-snapshot