Repository navigation
159 lines (137 loc) · 5.35 KB
/
Copy pathci.yml
File metadata and controls
159 lines (137 loc) · 5.35 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
name: CI
on:
push:
branches: [develop, main]
pull_request:
defaults:
run:
working-directory: oracledesk-stellar
env:
CARGO_TERM_COLOR: always
jobs:
rust:
name: Rust (fmt, clippy, test, wasm build)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32v1-none
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: "oracledesk-stellar -> target"
# Installed the same way this repo's contributors install it locally
# (`cargo install stellar-cli` — verified against the actual crate
# name behind the `stellar` binary, not a guessed GitHub Action).
- name: Install stellar CLI
run: cargo install --locked stellar-cli --version ${{ vars.STELLAR_CLI_VERSION || '27.1.0' }}
- name: cargo fmt --check
run: |
cargo fmt --check
cargo fmt --manifest-path scripts/interface-manifest/Cargo.toml --check
- name: cargo clippy
run: |
cargo clippy --workspace --all-targets -- -D warnings
CARGO_TARGET_DIR=target cargo clippy --locked --manifest-path scripts/interface-manifest/Cargo.toml --all-targets -- -D warnings
- name: cargo test
run: cargo test --workspace
- name: Build all contracts to wasm
run: |
stellar contract build
cp target/wasm32v1-none/release/market_core.wasm contracts/resolver/market_core.wasm
cp target/wasm32v1-none/release/market_core.wasm contracts/treasury/market_core.wasm
cp target/wasm32v1-none/release/reasoning_registry.wasm contracts/resolver/reasoning_registry.wasm
cp target/wasm32v1-none/release/market_core.wasm contracts/router/market_core.wasm
cp target/wasm32v1-none/release/resolver.wasm contracts/router/resolver.wasm
cp target/wasm32v1-none/release/reasoning_registry.wasm contracts/router/reasoning_registry.wasm
cp target/wasm32v1-none/release/resolver.wasm contracts/treasury/resolver.wasm
stellar contract build
- name: Fail if vendored wasm drifted from the build
run: |
git diff --exit-code -- \
contracts/resolver/market_core.wasm \
contracts/treasury/market_core.wasm \
contracts/treasury/resolver.wasm \
contracts/resolver/reasoning_registry.wasm \
contracts/router/market_core.wasm \
contracts/router/resolver.wasm \
contracts/router/reasoning_registry.wasm
- uses: actions/upload-artifact@v4
with:
name: contract-wasm
path: oracledesk-stellar/target/wasm32v1-none/release/*.wasm
python-model:
name: Python FPMM model
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: python3 model/fpmm_model.py
node:
name: Node (x402, agents)
runs-on: ubuntu-latest
needs: rust
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: actions/download-artifact@v4
with:
name: contract-wasm
path: oracledesk-stellar/target/wasm32v1-none/release
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: "oracledesk-stellar -> target"
- name: Install Stellar CLI
run: |
curl -fsSL https://github.com/stellar/stellar-cli/releases/download/v27.1.0/stellar-cli-27.1.0-x86_64-unknown-linux-gnu.tar.gz -o /tmp/stellar.tar.gz
mkdir -p "$RUNNER_TEMP/stellar-bin"
tar -xzf /tmp/stellar.tar.gz -C "$RUNNER_TEMP/stellar-bin" stellar
echo "$RUNNER_TEMP/stellar-bin" >> "$GITHUB_PATH"
- name: Generate bindings from the built wasm
run: |
chmod +x scripts/gen-bindings.sh
./scripts/gen-bindings.sh
- name: Check interface compatibility and versions
env:
INTERFACE_BASE_REF: origin/${{ github.base_ref || 'develop' }}
run: make interface-check
- name: Fail if committed bindings are stale
run: git diff --exit-code -- packages/bindings
- name: Install and build bindings packages
run: |
for pkg in market-core resolver treasury reasoning-registry timelock router; do
(cd "packages/bindings/$pkg" && npm install && npm run build)
done
- name: Interface tool tests
run: CARGO_TARGET_DIR=target cargo test --locked --manifest-path scripts/interface-manifest/Cargo.toml
- name: x402 — install, typecheck, test
run: |
cd x402
npm ci
npm run build
npm test
- name: agents — install, typecheck, test
run: |
cd agents
npm install
npm run build
npm test
# Fake-RPC fault injection against the real live adapter (#106). Uses
# the wasm downloaded above when it fits the adapter, else the vendored
# copies; deterministic (seeded faults, fake ledger clock), no network.
- name: agents — chaos tests
run: |
cd agents
npm run test:chaos