fix(installer): add absolute path resolution for Pro module in npx co… #310
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| # Story 6.1: Specialized testing (security, build, integration, performance) | |
| # Cross-platform compatibility testing moved to ci.yml | |
| # NOTE: Only runs on push to main (PRs use ci.yml for validation) | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - 'docs/**' | |
| - '*.md' | |
| - '.aios/**' | |
| - 'squads/**' | |
| workflow_dispatch: | |
| concurrency: | |
| group: test-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| NODE_VERSION: '20' | |
| jobs: | |
| # NOTE: Lint job removed (Story 6.1) - handled by ci.yml | |
| security-audit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run security audit | |
| run: | | |
| npm audit --audit-level=moderate || echo "Security audit completed with warnings" | |
| - name: Run penetration test | |
| run: | | |
| if [ -f "security/penetration-test.js" ]; then | |
| cd security | |
| node penetration-test.js | |
| else | |
| echo "Penetration test not found, skipping" | |
| fi | |
| build-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Test workspace package | |
| run: | | |
| echo "Testing workspace package: aios-core" | |
| # Check if package.json exists | |
| if [ -f "package.json" ]; then | |
| echo "✅ package.json exists" | |
| # Check if entry points exist | |
| if [ -f "index.js" ]; then | |
| echo "✅ index.js exists" | |
| else | |
| echo "ℹ️ index.js not found (CLI-based package)" | |
| fi | |
| # Validate package.json | |
| node -e " | |
| const pkg = require('./package.json'); | |
| console.log('✅ Package validation passed:', pkg.name); | |
| " | |
| else | |
| echo "❌ package.json not found" | |
| exit 1 | |
| fi | |
| - name: Test installer package | |
| run: | | |
| if [ -d "packages/installer" ]; then | |
| echo "Testing packages/installer" | |
| cd packages/installer | |
| if [ -f "package.json" ]; then | |
| echo "✅ Installer package.json exists" | |
| fi | |
| else | |
| echo "ℹ️ Installer package not found, skipping" | |
| fi | |
| integration-test: | |
| runs-on: ubuntu-latest | |
| needs: [security-audit, build-test] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Test CLI integration | |
| run: | | |
| # Test that CLI entry point works | |
| node -e " | |
| try { | |
| // Test bin/aios-init.js exists | |
| const fs = require('fs'); | |
| if (fs.existsSync('./bin/aios-init.js')) { | |
| console.log('✅ aios-init.js exists'); | |
| } else { | |
| console.log('❌ aios-init.js not found'); | |
| process.exit(1); | |
| } | |
| // Test bin/aios.js exists | |
| if (fs.existsSync('./bin/aios.js')) { | |
| console.log('✅ aios.js exists'); | |
| } else { | |
| console.log('❌ aios.js not found'); | |
| process.exit(1); | |
| } | |
| console.log('✅ CLI integration test passed'); | |
| } catch (error) { | |
| console.error('❌ CLI integration test failed:', error.message); | |
| process.exit(1); | |
| } | |
| " | |
| - name: Test core modules | |
| run: | | |
| # Test core scripts are loadable | |
| for script in health-check greeting-builder agent-parser; do | |
| SCRIPT_PATH=".aios-core/development/scripts/${script}.js" | |
| if [ -f "$SCRIPT_PATH" ]; then | |
| echo "✅ Found: $SCRIPT_PATH" | |
| else | |
| # Check alternative locations | |
| ALT_PATH=".aios-core/core/${script}.js" | |
| if [ -f "$ALT_PATH" ]; then | |
| echo "✅ Found: $ALT_PATH" | |
| else | |
| echo "ℹ️ Script not found: $script (may not be required)" | |
| fi | |
| fi | |
| done | |
| echo "✅ Core modules check completed" | |
| performance-test: | |
| runs-on: ubuntu-latest | |
| needs: [build-test] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run performance checks | |
| run: | | |
| # Basic performance checks | |
| echo "Running basic performance checks..." | |
| # Check file count in critical directories | |
| AGENT_COUNT=$(find .aios-core/development/agents -name "*.md" | wc -l) | |
| echo "✅ Agent definitions: $AGENT_COUNT" | |
| TASK_COUNT=$(find .aios-core/development/tasks -name "*.md" | wc -l) | |
| echo "✅ Task definitions: $TASK_COUNT" | |
| # Check manifest generation time | |
| START_TIME=$(date +%s%N) | |
| node scripts/generate-install-manifest.js > /dev/null 2>&1 | |
| END_TIME=$(date +%s%N) | |
| DURATION=$(( (END_TIME - START_TIME) / 1000000 )) | |
| echo "✅ Manifest generation: ${DURATION}ms" | |
| if [ "$DURATION" -gt 10000 ]; then | |
| echo "⚠️ Manifest generation took longer than expected" | |
| fi | |
| echo "✅ Performance checks completed" | |
| # NOTE: Cross-platform compatibility testing removed (Story 6.1) | |
| # Now handled by ci.yml cross-platform job (only on main branch push) | |
| summary: | |
| runs-on: ubuntu-latest | |
| needs: [security-audit, build-test, integration-test, performance-test] | |
| if: always() | |
| steps: | |
| - name: Test Summary | |
| run: | | |
| echo "## 📊 Test Results Summary" | |
| echo "" | |
| echo "| Test Suite | Status |" | |
| echo "|------------|--------|" | |
| echo "| Security Audit | ${{ needs.security-audit.result == 'success' && '✅ Passed' || '❌ Failed' }} |" | |
| echo "| Build Test | ${{ needs.build-test.result == 'success' && '✅ Passed' || '❌ Failed' }} |" | |
| echo "| Integration Test | ${{ needs.integration-test.result == 'success' && '✅ Passed' || '❌ Failed' }} |" | |
| echo "| Performance Test | ${{ needs.performance-test.result == 'success' && '✅ Passed' || '❌ Failed' }} |" | |
| echo "" | |
| echo "Note: Linting handled by ci.yml (Story 6.1)" | |
| echo "" | |
| # Overall status | |
| if [ "${{ needs.security-audit.result }}" = "success" ] && \ | |
| [ "${{ needs.build-test.result }}" = "success" ] && \ | |
| [ "${{ needs.integration-test.result }}" = "success" ] && \ | |
| [ "${{ needs.performance-test.result }}" = "success" ]; then | |
| echo "🎉 All critical tests passed!" | |
| echo "✅ Ready for deployment" | |
| else | |
| echo "❌ Some tests failed - review before deploying" | |
| exit 1 | |
| fi |