|
| 1 | +name: Test generate.sh |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: ["**"] |
| 6 | + pull_request: |
| 7 | + branches: ["**"] |
| 8 | + workflow_dispatch: {} |
| 9 | + |
| 10 | +jobs: |
| 11 | + generate: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - name: Checkout |
| 15 | + uses: actions/checkout@v4 |
| 16 | + |
| 17 | + - name: Run generator |
| 18 | + run: | |
| 19 | + bash ./generate.sh -y --force \ |
| 20 | + --project "CI Project" \ |
| 21 | + --team "CI Team" \ |
| 22 | + --stack "CI Stack" \ |
| 23 | + --specializations "Frontend,Backend,Testing" \ |
| 24 | + --tags "Performance,UX,Security" |
| 25 | +
|
| 26 | + - name: Assert outputs |
| 27 | + run: | |
| 28 | + set -euo pipefail |
| 29 | + files=( |
| 30 | + ".github/copilot-instructions.md" |
| 31 | + ".github/config/team-config.yml" |
| 32 | + ".github/config/phase-config.yml" |
| 33 | + ".github/config/tags.yml" |
| 34 | + ".github/prompts/01-requirements.prompt.md" |
| 35 | + "docs/requirements.md" |
| 36 | + "docs/user-stories.md" |
| 37 | + "docs/architecture/overview.md" |
| 38 | + "docs/framework/workflow-diagrams.md" |
| 39 | + "docs/memory.md" |
| 40 | + "docs/framework/usage-guide.md" |
| 41 | + ) |
| 42 | + for f in "${files[@]}"; do |
| 43 | + test -f "$f" || { echo "Missing $f"; exit 1; } |
| 44 | + test -s "$f" || { echo "Empty $f"; exit 1; } |
| 45 | + done |
| 46 | +
|
| 47 | + # Validate content substitutions |
| 48 | + grep -q "CI Project - Development Instructions" .github/copilot-instructions.md |
| 49 | + grep -q "Team: CI Team" .github/copilot-instructions.md |
| 50 | + grep -q "This is CI Project built with CI Stack." .github/copilot-instructions.md |
| 51 | +
|
| 52 | + grep -q "specializations:" .github/config/team-config.yml |
| 53 | + grep -q "- \"Frontend\"" .github/config/team-config.yml |
| 54 | + grep -q "- \"Backend\"" .github/config/team-config.yml |
| 55 | +
|
| 56 | + grep -q "custom:" .github/config/tags.yml |
| 57 | + grep -q "Performance" .github/config/tags.yml |
| 58 | + grep -q "UX" .github/config/tags.yml |
| 59 | +
|
| 60 | + grep -q "^## CI Project Memory" docs/memory.md |
| 61 | + grep -q "Project initialized with Copilot-centric prompt framework." docs/memory.md |
| 62 | +
|
| 63 | + # Ensure a reasonable number of prompts were generated |
| 64 | + test -d ".github/prompts" |
| 65 | + count=$(ls -1 .github/prompts/*.prompt.md | wc -l) |
| 66 | + if [ "$count" -lt 5 ]; then |
| 67 | + echo "Expected at least 5 prompt templates, found $count" |
| 68 | + exit 1 |
| 69 | + fi |
0 commit comments