-
Notifications
You must be signed in to change notification settings - Fork 0
281 lines (244 loc) · 12.1 KB
/
Copy pathci.yml
File metadata and controls
281 lines (244 loc) · 12.1 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch: # manual trigger for the heavy real-proof e2e job
jobs:
# ---------------------------------------------------------------------------
# Job 1: lint / format check
# ---------------------------------------------------------------------------
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install clang-format
run: sudo apt-get install -y clang-format
- name: Check C++ formatting (clang-format --dry-run)
run: |
find scaffold/src scaffold/interfaces \
\( -name '*.cpp' -o -name '*.h' \) \
-print0 \
| xargs -0 clang-format --dry-run --style=LLVM # advisory (no --Werror): reports diffs without failing the build
# ---------------------------------------------------------------------------
# Job 2: build the agent_module + lez_wallet_module plugins (nix-based)
# ---------------------------------------------------------------------------
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v14
- name: Enable flake cache (Magic Nix Cache)
uses: DeterminateSystems/magic-nix-cache-action@v8
# The flake.nix in scaffold/ uses logos-module-builder which provides
# Qt 6.9, logos-cpp-generator, nlohmann_json, cmake, ninja.
- name: Build agent_module plugin via nix
run: nix build ./scaffold#lib --out-link result-agent
env:
NIX_CONFIG: "experimental-features = nix-command flakes"
- name: Verify agent_module .so was produced
run: |
ls -lh result-agent/lib/
# There must be at least one shared library in the output
find result-agent/lib -name '*.so' | grep -q . \
|| { echo "ERROR: no .so found in result-agent/lib/"; exit 1; }
# The module manifest is the committed scaffold/metadata.json; it is
# deployed next to the built .so (the modules dir holds both). The #lib
# output ships only the library, so verify the manifest at its source.
test -f scaffold/metadata.json \
|| { echo "ERROR: scaffold/metadata.json (module manifest) missing"; exit 1; }
echo "OK: agent_module_plugin.so built + manifest present"
# TODO (runtime milestone): build the lez_wallet_module plugin once its
# flake/CMakeLists are authored (when its flake/CMakeLists are authored). Steps will mirror
# the block above with ./lez_wallet_module#lib instead of ./scaffold#lib.
# - name: Build lez_wallet_module plugin via nix
# run: nix build ./lez_wallet_module#lib --out-link result-wallet
- name: Upload built plugins as artifact
uses: actions/upload-artifact@v4
with:
name: agent-module-plugins
path: result-agent/
# ---------------------------------------------------------------------------
# Job 3: e2e-dev — fast dev-mode e2e (RISC0_DEV_MODE=1, runs on PUSH)
# Criterion #19: e2e integration tests run against a LEZ sequencer (standalone mode).
# Mirrors the e2e-sequencer boot pattern from LP-0002/LP-0003 exactly.
# Mock proofs (RISC0_DEV_MODE=1) keep this under CI time budget (~5 min).
# Full skill calls require logoscore (Logos platform binary, not buildable in stock CI);
# those are covered by the real-proof `e2e` job (workflow_dispatch) and demo-real.sh.
# ---------------------------------------------------------------------------
e2e-dev:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Clone LEZ (logos-execution-zone v0.1.2) as sibling lez-build
run: |
git clone --depth 1 --branch v0.1.2 \
https://github.com/logos-blockchain/logos-execution-zone.git \
"$GITHUB_WORKSPACE/../lez-build"
- name: Cache LEZ sequencer build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
../lez-build/target
key: ${{ runner.os }}-lez-v0.1.2-sequencer-dev
- name: Install logos-blockchain-circuits release v0.4.2
run: |
mkdir -p ~/.logos-blockchain-circuits
curl -sfL -o /tmp/circuits.tar.gz \
https://github.com/logos-blockchain/logos-blockchain-circuits/releases/download/v0.4.2/logos-blockchain-circuits-v0.4.2-linux-x86_64.tar.gz
tar -xzf /tmp/circuits.tar.gz -C ~/.logos-blockchain-circuits
inner=$(find ~/.logos-blockchain-circuits -maxdepth 1 -mindepth 1 -type d \
-name 'logos-blockchain-circuits-*' | head -1)
if [ -n "$inner" ]; then cp -r "$inner"/* ~/.logos-blockchain-circuits/; fi
ls ~/.logos-blockchain-circuits
- name: Build standalone sequencer
run: cargo build --release -p sequencer_service --features standalone
working-directory: ../lez-build
- name: Install r0vm (risc0 executor backend) v3.0.5
run: |
curl -sfL -o /tmp/crz.tgz \
https://github.com/risc0/risc0/releases/download/v3.0.5/cargo-risczero-x86_64-unknown-linux-gnu.tgz
tar -xzf /tmp/crz.tgz -C "$HOME/.cargo/bin" r0vm
chmod +x "$HOME/.cargo/bin/r0vm"
r0vm --version
- name: Download built agent_module plugins artifact
uses: actions/download-artifact@v4
with:
name: agent-module-plugins
path: result-agent/
- name: Start LEZ standalone sequencer (RISC0_DEV_MODE=1 — mock proofs, fast)
run: |
mkdir -p /tmp/lez-seq-home
RISC0_DEV_MODE=1 RUST_LOG=info RUST_BACKTRACE=1 \
../lez-build/target/release/sequencer_service \
.github/sequencer_config.json -p 3040 > /tmp/lez-seq.log 2>&1 &
echo "Waiting for sequencer to come up (up to 120s) ..."
for i in $(seq 1 60); do
curl -sf -m 2 -X POST http://127.0.0.1:3040 \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","method":"checkHealth","params":[],"id":1}' \
>/dev/null 2>&1 && echo "Sequencer ready after $((i*2))s." && exit 0
sleep 2
done
echo "ERROR: sequencer did not come up in 120s"; tail -80 /tmp/lez-seq.log; exit 1
- name: Run e2e-dev integration test
env:
RISC0_DEV_MODE: "1"
SEQUENCER: "http://127.0.0.1:3040"
MODULES_DIR: "${{ github.workspace }}/result-agent"
run: bash tests/e2e-dev.sh
- name: Sequencer log on failure
if: failure()
run: tail -100 /tmp/lez-seq.log
# ---------------------------------------------------------------------------
# Job 4: e2e — standalone LEZ sequencer + demo script
# Mirrors the e2e-sequencer job from LP-0002/LP-0003.
# RISC0_DEV_MODE=0 for this job (real proofs) as required by the spec.
# ---------------------------------------------------------------------------
e2e:
# Real-proof e2e (RISC0_DEV_MODE=0) takes minutes per proof and pulls the full
# LEZ stack — too heavy for push CI. Run on demand: `gh workflow run CI`.
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
# Clone logos-execution-zone v0.1.2 as sibling ../lez-build (same pattern as LP-0002/0003)
- name: Clone LEZ (logos-execution-zone v0.1.2) as sibling lez-build
run: |
git clone --depth 1 --branch v0.1.2 \
https://github.com/logos-blockchain/logos-execution-zone.git \
"$GITHUB_WORKSPACE/../lez-build"
- name: Cache LEZ sequencer build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
../lez-build/target
key: ${{ runner.os }}-lez-v0.1.2-sequencer
- name: Install logos-blockchain-circuits release v0.4.2
run: |
mkdir -p ~/.logos-blockchain-circuits
curl -sfL -o /tmp/circuits.tar.gz \
https://github.com/logos-blockchain/logos-blockchain-circuits/releases/download/v0.4.2/logos-blockchain-circuits-v0.4.2-linux-x86_64.tar.gz
tar -xzf /tmp/circuits.tar.gz -C ~/.logos-blockchain-circuits
# surface contents if the tarball nests a versioned sub-directory
inner=$(find ~/.logos-blockchain-circuits -maxdepth 1 -mindepth 1 -type d \
-name 'logos-blockchain-circuits-*' | head -1)
if [ -n "$inner" ]; then cp -r "$inner"/* ~/.logos-blockchain-circuits/; fi
ls ~/.logos-blockchain-circuits
- name: Build standalone sequencer
run: cargo build --release -p sequencer_service --features standalone
working-directory: ../lez-build
- name: Install r0vm (risc0 executor backend) v3.0.5
run: |
curl -sfL -o /tmp/crz.tgz \
https://github.com/risc0/risc0/releases/download/v3.0.5/cargo-risczero-x86_64-unknown-linux-gnu.tgz
tar -xzf /tmp/crz.tgz -C "$HOME/.cargo/bin" r0vm
chmod +x "$HOME/.cargo/bin/r0vm"
r0vm --version
- name: Install Nix (needed to build the module for the e2e run)
uses: DeterminateSystems/nix-installer-action@v14
- name: Enable flake cache (Magic Nix Cache)
uses: DeterminateSystems/magic-nix-cache-action@v8
- name: Build agent_module plugin for e2e
run: nix build ./scaffold#lib --out-link result-agent
env:
NIX_CONFIG: "experimental-features = nix-command flakes"
# logoscore CLI is used to load the module and call skills
- name: Build logoscore CLI from lez-build
# TODO (runtime milestone): replace with the canonical logos-logoscore-cli nix build
# once the package is published:
# nix build 'github:logos-co/logos-logoscore-cli' --out-link ./logoscore-bin
# For now, build from lez-build source which ships a compatible logoscore binary.
run: |
cargo build --release -p logoscore --features standalone 2>/dev/null \
|| cargo build --release -p logoscore_cli 2>/dev/null \
|| cargo build --release --bins 2>/dev/null \
|| true
find ../lez-build/target/release -maxdepth 1 -name 'logoscore*' -type f \
| head -5 || true
working-directory: ../lez-build
- name: Start LEZ standalone sequencer
run: |
mkdir -p /tmp/lez-seq-home
# RISC0_DEV_MODE=0 — real proofs (spec requirement)
RISC0_DEV_MODE=0 RUST_LOG=info RUST_BACKTRACE=1 \
../lez-build/target/release/sequencer_service \
.github/sequencer_config.json -p 3040 > /tmp/lez-seq.log 2>&1 &
echo "Waiting for sequencer to come up (up to 120s) ..."
for i in $(seq 1 60); do
curl -sf -m 2 -X POST http://127.0.0.1:3040 \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","method":"checkHealth","params":[],"id":1}' \
>/dev/null 2>&1 && echo "Sequencer ready after $((i*2))s." && exit 0
sleep 2
done
echo "ERROR: sequencer did not come up in 120s"; tail -80 /tmp/lez-seq.log; exit 1
- name: Set up modules directory for the demo
run: |
mkdir -p /tmp/agent-modules
cp -r result-agent/lib /tmp/agent-modules/
cp result-agent/metadata.json /tmp/agent-modules/
# TODO (runtime milestone): also copy lez_wallet_module .so once built
- name: Run e2e demo script
env:
RISC0_DEV_MODE: "0"
SEQUENCER: "http://127.0.0.1:3040"
MODULES_DIR: "/tmp/agent-modules"
# TODO (runtime milestone): set LOGOSCORE_BIN to the correct path once
# logoscore CLI build is resolved above.
LOGOSCORE_BIN: "${{ github.workspace }}/../lez-build/target/release/logoscore"
run: bash tests/e2e.sh
- name: Sequencer log on failure
if: failure()
run: tail -100 /tmp/lez-seq.log