Files
aitbc/.gitea/workflows/smart-contract-tests.yml
aitbc 23348892b9
Some checks failed
API Endpoint Tests / test-api-endpoints (push) Failing after 36s
CLI Tests / test-cli (push) Failing after 3m9s
Documentation Validation / validate-docs (push) Successful in 8s
Integration Tests / test-service-integration (push) Failing after 3s
JavaScript SDK Tests / test-js-sdk (push) Successful in 7s
Package Tests / test-python-packages (map[name:aitbc-agent-sdk path:packages/py/aitbc-agent-sdk]) (push) Failing after 8s
Package Tests / test-python-packages (map[name:aitbc-core path:packages/py/aitbc-core]) (push) Failing after 29s
Package Tests / test-python-packages (map[name:aitbc-crypto path:packages/py/aitbc-crypto]) (push) Failing after 13s
Package Tests / test-python-packages (map[name:aitbc-sdk path:packages/py/aitbc-sdk]) (push) Failing after 16s
Package Tests / test-javascript-packages (map[name:aitbc-sdk-js path:packages/js/aitbc-sdk]) (push) Successful in 7s
Package Tests / test-javascript-packages (map[name:aitbc-token path:packages/solidity/aitbc-token]) (push) Failing after 18s
Python Tests / test-python (push) Failing after 3m37s
Rust ZK Components Tests / test-rust-zk (push) Successful in 28s
Security Scanning / security-scan (push) Failing after 46s
Smart Contract Tests / test-solidity (map[name:aitbc-token path:packages/solidity/aitbc-token]) (push) Failing after 18s
Smart Contract Tests / test-solidity (map[name:zk-circuits path:apps/zk-circuits]) (push) Failing after 43s
Smart Contract Tests / lint-solidity (push) Failing after 12s
Staking Tests / test-staking-service (push) Failing after 2m33s
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) Failing after 4s
ci: enforce strict exit codes in workflow tests
- Remove `|| echo "⚠️ ..."` fallbacks that masked failures
- Add explicit `exit 1` on port readiness failures and missing test directories
- Track port_ready flag in health check loops to fail if services don't start
- Replace warning emoji (⚠️) with error emoji () for actual failures
- Fix docs-validation to use curated Markdown target list excluding high-noise directories
- Update rust-zk-tests paths from gpu_acceleration/research to dev
2026-04-18 11:57:35 +02:00

150 lines
5.0 KiB
YAML

name: Smart Contract Tests
on:
push:
branches: [main, develop]
paths:
- 'packages/solidity/**'
- 'apps/zk-circuits/**'
- '.gitea/workflows/smart-contract-tests.yml'
pull_request:
branches: [main, develop]
workflow_dispatch:
concurrency:
group: smart-contract-tests-${{ github.ref }}
cancel-in-progress: true
jobs:
test-solidity:
runs-on: debian
timeout-minutes: 15
strategy:
matrix:
project:
- name: "aitbc-token"
path: "packages/solidity/aitbc-token"
- name: "zk-circuits"
path: "apps/zk-circuits"
steps:
- name: Clone repository
run: |
WORKSPACE="/var/lib/aitbc-workspaces/solidity-${{ matrix.project.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
run: |
WORKSPACE="/var/lib/aitbc-workspaces/solidity-${{ matrix.project.name }}"
cd "$WORKSPACE/repo/${{ matrix.project.path }}"
echo "=== Testing ${{ matrix.project.name }} ==="
# Ensure standard directories exist
mkdir -p /var/lib/aitbc/data /var/lib/aitbc/keystore /etc/aitbc /var/log/aitbc
if [[ ! -f "package.json" ]]; then
echo "⚠️ No package.json, skipping"
exit 0
fi
echo "Node: $(node --version), npm: $(npm --version)"
# Install
npm install --legacy-peer-deps 2>/dev/null || npm install
# Fix missing Hardhat dependencies for aitbc-token
if [[ "${{ matrix.project.name }}" == "aitbc-token" ]]; then
echo "Installing missing Hardhat dependencies..."
npm install --no-save "@nomicfoundation/hardhat-ignition@^0.15.16" "@nomicfoundation/ignition-core@^0.15.15"
fi
# Compile
if [[ -f "hardhat.config.js" ]] || [[ -f "hardhat.config.ts" ]]; then
npx hardhat compile
echo "✅ Compiled"
npx hardhat test
echo "✅ Tests passed"
elif [[ -f "foundry.toml" ]]; then
forge build
echo "✅ Compiled"
forge test
echo "✅ Tests passed"
else
if node -e "const pkg=require('./package.json'); process.exit(pkg.scripts && pkg.scripts.compile ? 0 : 1)"; then
npm run compile
echo "✅ Compiled"
elif node -e "const pkg=require('./package.json'); process.exit(pkg.scripts && pkg.scripts.build ? 0 : 1)"; then
npm run build
echo "✅ Compiled"
else
echo "❌ No compile or build script found"
exit 1
fi
if node -e "const pkg=require('./package.json'); process.exit(pkg.scripts && pkg.scripts.test ? 0 : 1)"; then
npm test
echo "✅ Tests passed"
else
echo "❌ No test script found"
exit 1
fi
fi
echo "✅ ${{ matrix.project.name }} completed"
- name: Cleanup
if: always()
run: rm -rf "/var/lib/aitbc-workspaces/solidity-${{ matrix.project.name }}"
lint-solidity:
runs-on: debian
timeout-minutes: 10
steps:
- name: Clone repository
run: |
WORKSPACE="/var/lib/aitbc-workspaces/solidity-lint"
rm -rf "$WORKSPACE"
mkdir -p "$WORKSPACE"
cd "$WORKSPACE"
git clone --depth 1 http://gitea.bubuit.net:3000/oib/aitbc.git repo
- name: Lint contracts
run: |
cd /var/lib/aitbc-workspaces/solidity-lint/repo
# Ensure standard directories exist
mkdir -p /var/lib/aitbc/data /var/lib/aitbc/keystore /etc/aitbc /var/log/aitbc
for project in packages/solidity/aitbc-token apps/zk-circuits; do
if [[ -d "$project" ]] && [[ -f "$project/package.json" ]]; then
echo "=== Linting $project ==="
cd "$project"
npm install --legacy-peer-deps 2>/dev/null || npm install
# Fix missing Hardhat dependencies and formatting for aitbc-token
if [[ "$project" == "packages/solidity/aitbc-token" ]]; then
echo "Installing missing Hardhat dependencies..."
npm install --no-save "@nomicfoundation/hardhat-ignition@^0.15.16" "@nomicfoundation/ignition-core@^0.15.15"
fi
if node -e "const pkg=require('./package.json'); process.exit(pkg.scripts && pkg.scripts.lint ? 0 : 1)"; then
npm run lint
echo "✅ Lint passed"
else
echo "⚠️ No lint script for $project, skipping"
fi
cd /var/lib/aitbc-workspaces/solidity-lint/repo
fi
done
echo "✅ Solidity linting completed"
- name: Cleanup
if: always()
run: rm -rf /var/lib/aitbc-workspaces/solidity-lint