Files
aitbc/.gitea/workflows/package-tests.yml
aitbc 5ffba8fb1f
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
API Endpoint Tests / test-api-endpoints (push) Successful in 29s
CLI Tests / test-cli (push) Failing after 13s
Contract Performance Benchmarks / benchmark-gas-usage (push) Successful in 1m39s
Contract Performance Benchmarks / benchmark-execution-time (push) Successful in 1m30s
Contract Performance Benchmarks / benchmark-throughput (push) Successful in 1m33s
Documentation Validation / validate-docs (push) Failing after 12s
Documentation Validation / validate-policies-strict (push) Successful in 4s
Integration Tests / test-service-integration (push) Successful in 2m42s
JavaScript SDK Tests / test-js-sdk (push) Successful in 8s
Multi-Chain Island Architecture Tests / test-multi-chain-island (push) Successful in 3s
Multi-Node Blockchain Health Monitoring / health-check (push) Successful in 3s
P2P Network Verification / p2p-verification (push) Successful in 3s
Package Tests / Python package - aitbc-agent-sdk (push) Failing after 33s
Package Tests / Python package - aitbc-core (push) Successful in 17s
Package Tests / Python package - aitbc-crypto (push) Successful in 12s
Package Tests / Python package - aitbc-sdk (push) Successful in 13s
Package Tests / JavaScript package - aitbc-sdk-js (push) Successful in 7s
Package Tests / JavaScript package - aitbc-token (push) Successful in 16s
Production Tests / Production Integration Tests (push) Failing after 7s
Python Tests / test-python (push) Failing after 47s
Rust ZK Components Tests / test-rust-zk (push) Successful in 38s
Security Scanning / security-scan (push) Successful in 38s
Smart Contract Tests / test-solidity (map[name:aitbc-contracts path:contracts]) (push) Failing after 1m41s
Smart Contract Tests / test-solidity (map[name:aitbc-token path:packages/solidity/aitbc-token]) (push) Successful in 16s
Smart Contract Tests / test-foundry (push) Failing after 16s
Smart Contract Tests / lint-solidity (push) Successful in 22s
Smart Contract Tests / deploy-contracts (push) Successful in 1m47s
Staking Tests / test-staking-service (push) Failing after 4s
Staking Tests / test-staking-integration (push) Has been skipped
Staking Tests / test-staking-contract (push) Has been skipped
Staking Tests / run-staking-test-runner (push) Has been skipped
Systemd Sync / sync-systemd (push) Successful in 27s
Contract Performance Benchmarks / compare-benchmarks (push) Successful in 2s
ci: refactor Gitea workflows to use environment variables for workspace paths
- Added WORKSPACE env variable to all workflow jobs
- Changed hardcoded workspace paths to use ${{ env.WORKSPACE }}
- Updated paths in api-endpoint-tests.yml, build-miner-binary.yml, cli-level1-tests.yml, contract-benchmarks.yml, cross-node-transaction-testing.yml, and deployment-tests.yml
- Standardized workspace path references across all workflow files
2026-05-11 14:52:36 +02:00

210 lines
6.8 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"
env:
WORKSPACE: /var/lib/aitbc-workspaces/pkg-${{ matrix.package.name }}
steps:
- name: Clone repository
run: |
rm -rf "${{ env.WORKSPACE }}"
mkdir -p "${{ env.WORKSPACE }}"
cd "${{ env.WORKSPACE }}"
git clone --depth 1 http://gitea.bubuit.net:3000/oib/aitbc.git repo
- name: Initialize job logging
run: |
cd "${{ env.WORKSPACE }}/repo"
bash scripts/ci/setup-job-logging.sh
- name: Setup and test package
run: |
cd "${{ env.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
# Remove any existing venv to avoid cache corruption issues
rm -rf venv venv-build
bash "${{ env.WORKSPACE }}/repo/scripts/ci/setup-python-venv.sh" \
--repo-dir "$PWD" \
--venv-dir "$PWD/venv" \
--mode copy \
--extra-packages "pytest mypy black pydantic-settings fastapi uvicorn httpx requests"
if [[ "${{ matrix.package.name }}" == "aitbc-sdk" ]]; then
venv/bin/python -m pip install -q -e "${{ env.WORKSPACE }}/repo/packages/py/aitbc-crypto"
fi
# Install dependencies
if [[ -f "pyproject.toml" ]]; then
venv/bin/python -m pip install -q -e ".[dev]" 2>/dev/null || venv/bin/python -m pip install -q -e .
fi
if [[ -f "requirements.txt" ]]; then
venv/bin/python -m pip install -q -r requirements.txt
fi
# Verify package installation
echo "=== Installed packages ==="
venv/bin/python -m pip list | grep -i aitbc || true
# Linting
echo "=== Linting ==="
if [[ -d "src" ]]; then
venv/bin/python -m mypy src/ --ignore-missing-imports --no-error-summary 2>/dev/null || echo "⚠️ MyPy warnings"
venv/bin/python -m black --check src/ 2>/dev/null || echo "⚠️ Black warnings"
fi
# Tests
echo "=== Tests ==="
if [[ -d "tests" ]]; then
# Make package src first, then repo root for shared imports (e.g. `from aitbc import ...`)
# Combined with `-c /dev/null`, this avoids monorepo pytest.ini path conflicts.
export PYTHONPATH="$PWD/src:${{ env.WORKSPACE }}/repo:$PYTHONPATH"
echo "=== Debug Info ==="
echo "PWD: $PWD"
echo "PYTHONPATH: $PYTHONPATH"
echo "Package name: ${{ matrix.package.name }}"
echo "=== Package Installation Status ==="
venv/bin/python -m pip show aitbc-core || echo "aitbc-core not installed"
echo "=== Import Test ==="
venv/bin/python -c "import sys; print('Python paths:'); [print(p) for p in sys.path]"
echo "=== Test Import ==="
if [[ "${{ matrix.package.name }}" == "aitbc-core" ]]; then
venv/bin/python -c "from aitbc.logging import StructuredLogFormatter; print('Import successful')" || echo "Import failed"
else
echo "Skipping aitbc.logging import check for ${{ matrix.package.name }}"
fi
echo "=== Running Tests ==="
venv/bin/python -m pytest -c /dev/null --rootdir "$PWD" --import-mode=importlib tests/ -q --tb=short
else
echo "⚠️ No tests directory found"
fi
echo "✅ ${{ matrix.package.name }} testing completed"
- name: Build package
run: |
cd "${{ env.WORKSPACE }}/repo/${{ matrix.package.path }}"
if [[ -f "pyproject.toml" ]]; then
bash "${{ env.WORKSPACE }}/repo/scripts/ci/setup-python-venv.sh" \
--repo-dir "$PWD" \
--venv-dir "$PWD/venv-build" \
--skip-requirements \
--extra-packages "build"
venv-build/bin/python -m build
echo "✅ Package built"
fi
- name: Cleanup
if: always()
run: rm -rf "${{ env.WORKSPACE }}"
test-javascript-packages:
name: JavaScript package - ${{ matrix.package.name }}
runs-on: debian
timeout-minutes: 30
strategy:
max-parallel: 1
matrix:
package:
- name: "aitbc-sdk-js"
path: "packages/js/aitbc-sdk"
- name: "aitbc-token"
path: "packages/solidity/aitbc-token"
env:
WORKSPACE: /var/lib/aitbc-workspaces/jspkg-${{ matrix.package.name }}
steps:
- name: Clone repository
run: |
rm -rf "${{ env.WORKSPACE }}"
mkdir -p "${{ env.WORKSPACE }}"
cd "${{ env.WORKSPACE }}"
git clone --depth 1 http://gitea.bubuit.net:3000/oib/aitbc.git repo
- name: Initialize job logging
run: |
cd "${{ env.WORKSPACE }}/repo"
bash scripts/ci/setup-job-logging.sh
- name: Setup and test package
run: |
cd "${{ env.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
if [[ -f "package-lock.json" ]]; then
npm ci --legacy-peer-deps --no-audit --no-fund
else
npm install --legacy-peer-deps --no-audit --no-fund
fi
# Build
npm run build
echo "✅ Build passed"
# Lint
npm run lint 2>/dev/null && echo "✅ Lint passed" || echo "⚠️ Lint skipped"
# Test
if [[ "${{ matrix.package.name }}" == "aitbc-token" ]]; then
npx hardhat test --no-compile
else
npm test
fi
echo "✅ Tests passed"
echo "✅ ${{ matrix.package.name }} completed"
- name: Cleanup
if: always()
run: rm -rf "${{ env.WORKSPACE }}"