-
Notifications
You must be signed in to change notification settings - Fork 30
92 lines (73 loc) · 3.1 KB
/
sonarqube.yml
File metadata and controls
92 lines (73 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: SonarQube Analysis
on:
push:
branches: [ main, develop, add-sonarqube-integration ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
sonarqube:
uses: NVIDIA-AI-Blueprints/sonarqube-workflows/.github/workflows/sonarqube-reusable-template.yml@main
with:
# Language and test configuration
language: python
languageVersion: '3.11'
# Override test execution to generate both Python and frontend coverage
testCommand: |
set -euxo pipefail
echo "===== Installing test dependencies ====="
uv pip install pytest-asyncio
echo "===== Python tests + coverage ====="
uv run pytest tests/ \
--ignore=tests/integration \
--ignore=tests/performance \
--ignore=tests/quality \
--ignore=tests/unit/test_chunking_demo.py \
--ignore=tests/unit/test_db_connection.py \
--ignore=tests/unit/test_document_pipeline.py \
--ignore=tests/unit/test_enhanced_retrieval.py \
--ignore=tests/unit/test_evidence_scoring_demo.py \
--ignore=tests/unit/test_mcp_planner_integration.py \
--ignore=tests/unit/test_mcp_system.py \
--ignore=tests/unit/test_migration_system.py \
--cov=src \
--cov-report=xml:coverage.xml \
--cov-report=term-missing
echo "===== Verify Python coverage ====="
test -f coverage.xml
head -n 5 coverage.xml || true
echo "===== Setting up Node.js ====="
# Install Node.js 20 (LTS) directly - more reliable in CI
if ! command -v node &> /dev/null; then
NODE_VERSION="20.18.0"
NODE_DISTRO="linux-x64"
NODE_URL="https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-${NODE_DISTRO}.tar.xz"
echo "Downloading Node.js ${NODE_VERSION}..."
curl -fsSL "${NODE_URL}" -o /tmp/node.tar.xz
echo "Extracting Node.js..."
tar -xJf /tmp/node.tar.xz -C /tmp
echo "Setting up Node.js PATH..."
export PATH="/tmp/node-v${NODE_VERSION}-${NODE_DISTRO}/bin:$PATH"
fi
# Verify Node.js installation
node --version || (echo "Node.js installation failed" && exit 1)
npm --version || (echo "npm installation failed" && exit 1)
echo "===== Frontend tests + coverage ====="
cd src/ui/web
# Clean install to ensure compatibility (keep package-lock.json for npm ci)
rm -rf node_modules
npm ci
# Run tests with coverage
npm test -- --coverage --watchAll=false
echo "===== Verify Frontend coverage ====="
test -f coverage/lcov.info
head -n 5 coverage/lcov.info || true
cd ../../..
# Project creation parameters
organization: TEGRASW
team: Blueprints-SRE
product: warehouse-operational-assistant
scmRepoName: Multi-Agent-Intelligent-Warehouse
# Optional parameters
projectTags: ai-blueprint,warehouse,multi-agent
secrets: inherit