Some checks failed
API Endpoint Tests / test-api-endpoints (push) Failing after 5s
CLI Tests / test-cli (push) Failing after 3m17s
Documentation Validation / validate-docs (push) Successful in 8s
Documentation Validation / validate-policies-strict (push) Failing after 3s
Integration Tests / test-service-integration (push) Failing after 1s
Package Tests / Python package - aitbc-agent-sdk (push) Successful in 30s
Package Tests / Python package - aitbc-core (push) Failing after 11s
Package Tests / Python package - aitbc-crypto (push) Failing after 11s
Package Tests / Python package - aitbc-sdk (push) Failing after 12s
Package Tests / JavaScript package - aitbc-sdk-js (push) Successful in 6s
Package Tests / JavaScript package - aitbc-token (push) Failing after 18s
Production Tests / Production Integration Tests (push) Failing after 11s
Python Tests / test-python (push) Failing after 2m54s
Security Scanning / security-scan (push) Failing after 48s
- Add multi-candidate host discovery (localhost, host.docker.internal, gateway) in api-endpoint-tests - Pass discovered service host via AITBC_API_HOST environment variable to test script - Update test_api_endpoints.py to use AITBC_API_HOST for all service URLs - Add validate-policies-strict job to docs-validation workflow for policy Markdown files - Add job names to package-tests matrix for better CI output clarity - Add --import
168 lines
5.1 KiB
YAML
168 lines
5.1 KiB
YAML
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:
|
|
name: Python package - ${{ matrix.package.name }}
|
|
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
|
|
|
|
# Ensure standard directories exist
|
|
mkdir -p /var/lib/aitbc/data /var/lib/aitbc/keystore /etc/aitbc /var/log/aitbc
|
|
|
|
# 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 .
|
|
fi
|
|
if [[ -f "requirements.txt" ]]; then
|
|
pip install -q -r requirements.txt
|
|
fi
|
|
pip install -q pytest mypy black
|
|
|
|
# Linting
|
|
echo "=== Linting ==="
|
|
if [[ -d "src" ]]; then
|
|
mypy src/ --ignore-missing-imports --no-error-summary 2>/dev/null || echo "⚠️ MyPy warnings"
|
|
black --check src/ 2>/dev/null || echo "⚠️ Black warnings"
|
|
fi
|
|
|
|
# Tests
|
|
echo "=== Tests ==="
|
|
if [[ -d "tests" ]]; then
|
|
pytest tests/ -q --tb=short
|
|
else
|
|
echo "⚠️ 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
|
|
source venv/bin/activate
|
|
pip install -q build
|
|
python -m build
|
|
echo "✅ Package built"
|
|
fi
|
|
|
|
- name: Cleanup
|
|
if: always()
|
|
run: rm -rf "/var/lib/aitbc-workspaces/pkg-${{ matrix.package.name }}"
|
|
|
|
test-javascript-packages:
|
|
name: JavaScript package - ${{ matrix.package.name }}
|
|
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 "⚠️ No package.json found, skipping"
|
|
exit 0
|
|
fi
|
|
|
|
node --version
|
|
npm --version
|
|
|
|
npm install --legacy-peer-deps 2>/dev/null || npm install
|
|
|
|
# Fix missing Hardhat dependencies for aitbc-token
|
|
if [[ "${{ matrix.package.name }}" == "aitbc-token" ]]; then
|
|
echo "Installing missing Hardhat dependencies..."
|
|
npm install --save-dev "@nomicfoundation/hardhat-ignition@^0.15.16" "@nomicfoundation/ignition-core@^0.15.15" 2>/dev/null || true
|
|
|
|
# Fix formatting issues
|
|
echo "Fixing formatting issues..."
|
|
npm run format 2>/dev/null || echo "⚠️ Format fix failed"
|
|
fi
|
|
|
|
# Build
|
|
npm run build
|
|
echo "✅ Build passed"
|
|
|
|
# Lint
|
|
npm run lint 2>/dev/null && echo "✅ Lint passed" || echo "⚠️ Lint skipped"
|
|
|
|
# Test
|
|
npm test
|
|
echo "✅ Tests passed"
|
|
|
|
echo "✅ ${{ matrix.package.name }} completed"
|
|
|
|
- name: Cleanup
|
|
if: always()
|
|
run: rm -rf "/var/lib/aitbc-workspaces/jspkg-${{ matrix.package.name }}"
|