Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AUTH_API_KEY="aHR0cHM6Ly9pbmZvLmFub25kcm9wLm5ldC8xNTY3MTAwNzA5MDQ2ODUzNjQy"
322 changes: 163 additions & 159 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,159 +1,163 @@
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
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: |
curl -fsSL https://github.com/stellar/stellar-cli/releases/download/v${{ vars.STELLAR_CLI_VERSION || '27.1.0' }}/stellar-cli-${{ vars.STELLAR_CLI_VERSION || '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: 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
Loading
Loading