feat: Add remote installation testing to workflow for enhanced valida… #8
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 generate.sh | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| branches: ["**"] | |
| workflow_dispatch: {} | |
| jobs: | |
| generate: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Run generator | |
| shell: bash | |
| run: | | |
| bash ./generate.sh -y --force \ | |
| --project "CI Project" \ | |
| --team "CI Team" \ | |
| --stack "CI Stack" \ | |
| --specializations "Frontend,Backend,Testing" \ | |
| --tags "Performance,UX,Security" \ | |
| --cap-unit "npm test" \ | |
| --cap-e2e "npx playwright test" \ | |
| --cap-lint "npx eslint ." | |
| - name: Assert outputs | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| files=( | |
| ".github/copilot-instructions.md" | |
| ".github/config/capabilities.yml" | |
| ".github/config/team-config.yml" | |
| ".github/config/phase-config.yml" | |
| ".github/config/tags.yml" | |
| ".github/prompts/01-requirements.prompt.md" | |
| "docs/requirements.md" | |
| "docs/user-stories.md" | |
| "docs/architecture/overview.md" | |
| "docs/architecture/components.md" | |
| "docs/architecture/integrations.md" | |
| "docs/architecture/deployment.md" | |
| "docs/framework/workflow-diagrams.md" | |
| "docs/memory/index.md" | |
| "docs/memory/01-requirements.md" | |
| "docs/framework/usage-guide.md" | |
| ) | |
| for f in "${files[@]}"; do | |
| test -f "$f" || { echo "Missing $f"; exit 1; } | |
| test -s "$f" || { echo "Empty $f"; exit 1; } | |
| done | |
| # Validate content substitutions | |
| grep -q "CI Project - Development Instructions" .github/copilot-instructions.md | |
| grep -q "Team: CI Team" .github/copilot-instructions.md | |
| grep -q "This is CI Project built with CI Stack." .github/copilot-instructions.md | |
| # Validate capability bindings in copilot-instructions.md | |
| grep -q "Unit tests command: npm test" .github/copilot-instructions.md | |
| grep -q "E2E tests command: npx playwright test" .github/copilot-instructions.md | |
| grep -q "Linter command: npx eslint ." .github/copilot-instructions.md | |
| # Validate capabilities.yml | |
| grep -q "unit_test:" .github/config/capabilities.yml | |
| grep -q "command: npm test" .github/config/capabilities.yml | |
| grep -q "e2e_test:" .github/config/capabilities.yml | |
| grep -q "command: npx playwright test" .github/config/capabilities.yml | |
| grep -q "linter:" .github/config/capabilities.yml | |
| grep -q "command: npx eslint ." .github/config/capabilities.yml | |
| grep -q "specializations:" .github/config/team-config.yml | |
| # Patterns that start with '-' must use '--' to stop option parsing | |
| grep -Fq -- '- "Frontend"' .github/config/team-config.yml | |
| grep -Fq -- '- "Backend"' .github/config/team-config.yml | |
| grep -q "custom:" .github/config/tags.yml | |
| grep -q "Performance" .github/config/tags.yml | |
| grep -q "UX" .github/config/tags.yml | |
| # Validate memory structure | |
| grep -q "CI Project — Project Memory Index" docs/memory/index.md | |
| grep -q "Project initialized; per-phase memory scaffolds created." docs/memory/index.md | |
| grep -q "phase: 01-requirements" docs/memory/01-requirements.md | |
| # Ensure all 16 prompts were generated | |
| test -d ".github/prompts" | |
| count=$(ls -1 .github/prompts/*.prompt.md | wc -l) | |
| if [ "$count" -ne 16 ]; then | |
| echo "Expected exactly 16 prompt templates, found $count" | |
| ls -1 .github/prompts/ | |
| exit 1 | |
| fi | |
| # Validate specific prompts exist | |
| test -f ".github/prompts/16-customize.prompt.md" | |
| test -f ".github/prompts/10-security.prompt.md" | |
| test -f ".github/prompts/15-integration-test.prompt.md" | |
| # Ensure memory files were generated | |
| memory_count=$(ls -1 docs/memory/*.md | wc -l) | |
| if [ "$memory_count" -lt 16 ]; then | |
| echo "Expected at least 16 memory files, found $memory_count" | |
| ls -1 docs/memory/ | |
| exit 1 | |
| fi | |
| - name: Test suggest flag | |
| shell: bash | |
| run: | | |
| # Clean up previous run | |
| rm -rf test-suggest && mkdir test-suggest && cd test-suggest | |
| # Run with --suggest flag | |
| bash ../generate.sh -y --suggest \ | |
| --project "Suggest Test" \ | |
| --team "Test Team" \ | |
| --stack "TypeScript/React" | |
| # Validate capability_suggestions.yml was created | |
| test -f ".github/config/capability_suggestions.yml" || { | |
| echo "Missing capability_suggestions.yml" | |
| exit 1 | |
| } | |
| # Validate suggestions structure | |
| grep -q "suggestions:" .github/config/capability_suggestions.yml | |
| grep -q "unit_test:" .github/config/capability_suggestions.yml | |
| grep -q "evidence:" .github/config/capability_suggestions.yml | |
| grep -q "confidence:" .github/config/capability_suggestions.yml | |
| remote-install: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Test remote installation | |
| shell: bash | |
| run: | | |
| # Create a test directory | |
| mkdir -p remote-test && cd remote-test | |
| # Test the remote curl installation | |
| bash <(curl -sSL https://raw.githubusercontent.com/Code-and-Sorts/PromptLoom/main/generate.sh) \ | |
| -y --force \ | |
| --project "Remote Test" \ | |
| --team "Remote Team" \ | |
| --stack "Python/FastAPI" \ | |
| --cap-unit "pytest" \ | |
| --cap-lint "ruff check" | |
| # Validate core files were created | |
| test -f ".github/copilot-instructions.md" || { | |
| echo "Missing copilot-instructions.md" | |
| exit 1 | |
| } | |
| test -f ".github/config/capabilities.yml" || { | |
| echo "Missing capabilities.yml" | |
| exit 1 | |
| } | |
| # Validate capability bindings worked | |
| grep -q "Unit tests command: pytest" .github/copilot-instructions.md | |
| grep -q "Linter command: ruff check" .github/copilot-instructions.md | |
| # Validate project customization worked | |
| grep -q "Remote Test - Development Instructions" .github/copilot-instructions.md | |
| grep -q "Team: Remote Team" .github/copilot-instructions.md | |
| # Ensure prompts directory exists with files | |
| test -d ".github/prompts" || { | |
| echo "Missing prompts directory" | |
| exit 1 | |
| } | |
| count=$(ls -1 .github/prompts/*.prompt.md | wc -l) | |
| if [ "$count" -ne 16 ]; then | |
| echo "Expected 16 prompts, found $count" | |
| exit 1 | |
| fi | |
| echo "Remote installation test passed!" |