Files
aitbc/.gitea/workflows/package-tests.yml
aitbc1 8b8d639bf7
All checks were successful
API Endpoint Tests / test-api-endpoints (push) Successful in 39s
Integration Tests / test-service-integration (push) Successful in 44s
Package Tests / test-python-packages (map[name:aitbc-core path:packages/py/aitbc-core]) (push) Successful in 16s
Package Tests / test-python-packages (map[name:aitbc-agent-sdk path:packages/py/aitbc-agent-sdk]) (push) Successful in 30s
Package Tests / test-python-packages (map[name:aitbc-crypto path:packages/py/aitbc-crypto]) (push) Successful in 20s
Package Tests / test-python-packages (map[name:aitbc-sdk path:packages/py/aitbc-sdk]) (push) Successful in 20s
Package Tests / test-javascript-packages (map[name:aitbc-sdk-js path:packages/js/aitbc-sdk]) (push) Successful in 17s
Package Tests / test-javascript-packages (map[name:aitbc-token path:packages/solidity/aitbc-token]) (push) Successful in 1m17s
Python Tests / test-python (push) Successful in 1m7s
Smart Contract Tests / test-solidity (map[name:aitbc-token path:packages/solidity/aitbc-token]) (push) Successful in 30s
Security Scanning / security-scan (push) Successful in 1m5s
Smart Contract Tests / test-solidity (map[name:zk-circuits path:apps/zk-circuits]) (push) Successful in 49s
Smart Contract Tests / lint-solidity (push) Successful in 54s
fix: resolve CI failures across all workflows
aitbc-agent-sdk (package-tests.yml):
- Add AITBCAgent convenience class matching test expectations
- Fix test_agent_sdk.py: was importing nonexistent AITBCAgent, now tests
  the real API (Agent.create, AgentCapabilities, to_dict) plus AITBCAgent
- Fix 3 remaining mypy errors: supported_models Optional coercion (line 64),
  missing return types on _submit_to_marketplace/_update_marketplace_offer
- Run black on all 5 src files — zero mypy errors, zero black warnings
- All 6 tests pass

python-tests.yml:
- Add pynacl to pip install (aitbc-crypto and aitbc-sdk import nacl)
- Add pynacl>=1.5.0 to root requirements.txt

Service readiness (api-endpoint-tests.yml, integration-tests.yml):
- Replace curl -sf with curl http_code check — -sf fails on 404 responses
  but port 8006 (blockchain RPC) returns 404 on / while being healthy
- Blockchain RPC uses REST /rpc/* endpoints, not JSON-RPC POST to /
  Fix test_api_endpoints.py to test /health, /rpc/head, /rpc/info, /rpc/supply
- Remove dead test_rpc() function, add blockchain RPC to perf tests
- All 4 services now pass: coordinator, exchange, wallet, blockchain_rpc
- Integration-tests: check is-active before systemctl start to avoid
  spurious warnings for already-running services

Hardhat compile (smart-contract-tests.yml, package-tests.yml):
- Relax engines field from >=24.14.0 to >=18.0.0 (CI has v24.13.0)
- Remove 2>/dev/null from hardhat compile/test so errors are visible
- Remove 2>/dev/null from npm run build/test in package-tests JS section
2026-03-29 13:20:58 +02:00

150 lines
4.6 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Package Tests
on:
push:
branches: [main, develop]
paths:
- 'packages/**'
- 'pyproject.toml'
- '.gitea/workflows/package-tests.yml'
pull_request:
branches: [main, develop]
workflow_dispatch:
concurrency:
group: package-tests-${{ github.ref }}
cancel-in-progress: true
jobs:
test-python-packages:
runs-on: debian
timeout-minutes: 15
strategy:
matrix:
package:
- name: "aitbc-core"
path: "packages/py/aitbc-core"
- name: "aitbc-crypto"
path: "packages/py/aitbc-crypto"
- name: "aitbc-sdk"
path: "packages/py/aitbc-sdk"
- name: "aitbc-agent-sdk"
path: "packages/py/aitbc-agent-sdk"
steps:
- name: Clone repository
run: |
WORKSPACE="/var/lib/aitbc-workspaces/pkg-${{ matrix.package.name }}"
rm -rf "$WORKSPACE"
mkdir -p "$WORKSPACE"
cd "$WORKSPACE"
git clone --depth 1 http://gitea.bubuit.net:3000/oib/aitbc.git repo
- name: Setup and test package
run: |
WORKSPACE="/var/lib/aitbc-workspaces/pkg-${{ matrix.package.name }}"
cd "$WORKSPACE/repo/${{ matrix.package.path }}"
echo "=== Testing ${{ matrix.package.name }} ==="
echo "Directory: $(pwd)"
ls -la
# Create venv
python3 -m venv venv
source venv/bin/activate
pip install -q --upgrade pip setuptools wheel
# Install dependencies
if [[ -f "pyproject.toml" ]]; then
pip install -q -e ".[dev]" 2>/dev/null || pip install -q -e . 2>/dev/null || true
fi
if [[ -f "requirements.txt" ]]; then
pip install -q -r requirements.txt 2>/dev/null || true
fi
pip install -q pytest mypy black 2>/dev/null || true
# Linting
echo "=== Linting ==="
if [[ -d "src" ]]; then
mypy src/ --ignore-missing-imports --no-error-summary 2>/dev/null || echo "âš ï¸<C3AF> MyPy warnings"
black --check src/ 2>/dev/null || echo "âš ï¸<C3AF> Black warnings"
fi
# Tests
echo "=== Tests ==="
if [[ -d "tests" ]]; then
pytest tests/ -q --tb=short || echo "âš ï¸<C3AF> Some tests failed"
else
echo "âš ï¸<C3AF> No tests directory found"
fi
echo "✅ ${{ matrix.package.name }} testing completed"
- name: Build package
run: |
WORKSPACE="/var/lib/aitbc-workspaces/pkg-${{ matrix.package.name }}"
cd "$WORKSPACE/repo/${{ matrix.package.path }}"
if [[ -f "pyproject.toml" ]]; then
python3 -m venv venv 2>/dev/null || true
source venv/bin/activate
pip install -q build 2>/dev/null || true
python -m build 2>/dev/null && echo "✅ Package built" || echo "âš ï¸<C3AF> Build failed"
fi
- name: Cleanup
if: always()
run: rm -rf "/var/lib/aitbc-workspaces/pkg-${{ matrix.package.name }}"
test-javascript-packages:
runs-on: debian
timeout-minutes: 15
strategy:
matrix:
package:
- name: "aitbc-sdk-js"
path: "packages/js/aitbc-sdk"
- name: "aitbc-token"
path: "packages/solidity/aitbc-token"
steps:
- name: Clone repository
run: |
WORKSPACE="/var/lib/aitbc-workspaces/jspkg-${{ matrix.package.name }}"
rm -rf "$WORKSPACE"
mkdir -p "$WORKSPACE"
cd "$WORKSPACE"
git clone --depth 1 http://gitea.bubuit.net:3000/oib/aitbc.git repo
- name: Setup and test package
run: |
WORKSPACE="/var/lib/aitbc-workspaces/jspkg-${{ matrix.package.name }}"
cd "$WORKSPACE/repo/${{ matrix.package.path }}"
echo "=== Testing ${{ matrix.package.name }} ==="
if [[ ! -f "package.json" ]]; then
echo "âš ï¸<C3AF> No package.json found, skipping"
exit 0
fi
node --version
npm --version
npm install --legacy-peer-deps 2>/dev/null || npm install 2>/dev/null || true
# Build
npm run build && echo "✅ Build passed" || echo "âš ï¸<C3AF> Build failed"
# Lint
npm run lint 2>/dev/null && echo "✅ Lint passed" || echo "âš ï¸<C3AF> Lint skipped"
# Test
npm test && echo "✅ Tests passed" || echo "âš ï¸<C3AF> Tests skipped"
echo "✅ ${{ matrix.package.name }} completed"
- name: Cleanup
if: always()
run: rm -rf "/var/lib/aitbc-workspaces/jspkg-${{ matrix.package.name }}"