-
Notifications
You must be signed in to change notification settings - Fork 0
169 lines (144 loc) · 4.83 KB
/
ci-full-test.yml
File metadata and controls
169 lines (144 loc) · 4.83 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# ============================================================================
# CI Full Test Workflow
# ============================================================================
# This workflow validates the framework on every push and pull request:
# - Agent validation: structural checks, cross-reference verification,
# and domain-specific rule enforcement for all .agent.md,
# .instructions.md, .prompt.md, and SKILL.md files.
# - Sample app tests: lint, type-check, and Jest test suite.
#
# Results are uploaded as SARIF to the GitHub Security tab.
# ============================================================================
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: CI Full Test
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
security-events: write
contents: read
actions: read
jobs:
agent-validation:
name: Agent Validation — Structure, Cross-Refs, Domain Rules
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install validation dependencies
working-directory: scripts
run: npm ci
- name: Run agent validation
id: validate
run: node scripts/validate-agents.mjs
- name: Upload validation SARIF
if: always()
uses: github/codeql-action/upload-sarif@v4
continue-on-error: true
with:
sarif_file: validation-results.sarif
category: agent-validation/
apm-security:
name: APM — Agent Config Security Audit
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run APM audit
uses: microsoft/apm-action@v1
continue-on-error: true
with:
audit-report: true
- name: Upload APM SARIF
if: always() && hashFiles('apm-audit.sarif') != ''
uses: github/codeql-action/upload-sarif@v4
continue-on-error: true
with:
sarif_file: apm-audit.sarif
category: apm-audit/
sample-app-quality:
name: Sample App — Lint, Type Check, Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: sample-app
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install dependencies
run: npm install
- name: Lint
run: npm run lint
continue-on-error: true
- name: Type check
run: npx tsc --noEmit
continue-on-error: true
- name: Test with coverage
run: npm run test:ci
continue-on-error: true
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
if-no-files-found: ignore
path: |
sample-app/junit.xml
sample-app/coverage/
summary:
name: CI Summary
runs-on: ubuntu-latest
if: always()
needs: [agent-validation, apm-security, sample-app-quality]
steps:
- name: Generate summary
env:
AGENT_RESULT: ${{ needs.agent-validation.result }}
APM_RESULT: ${{ needs.apm-security.result }}
APP_RESULT: ${{ needs.sample-app-quality.result }}
run: |
STATUS_ICON() {
case "$1" in
success) echo "✅" ;;
failure) echo "❌" ;;
cancelled) echo "⏭️" ;;
skipped) echo "⏭️" ;;
*) echo "❓" ;;
esac
}
cat >> "$GITHUB_STEP_SUMMARY" << EOF
## 🔬 CI Full Test Results
### Job Results
| Job | Status |
|-----|--------|
| Agent Validation (15 agents, 3 instructions, 2 prompts, 2 skills) | $(STATUS_ICON "$AGENT_RESULT") $AGENT_RESULT |
| APM Security Audit | $(STATUS_ICON "$APM_RESULT") $APM_RESULT |
| Sample App Quality (lint, type-check, test) | $(STATUS_ICON "$APP_RESULT") $APP_RESULT |
### Domain Coverage
| Domain | Agents | Scope |
|--------|--------|-------|
| Security | 6 | OWASP Top 10, CWE, SARIF output |
| Accessibility | 2 | WCAG 2.2, axe-core |
| Code Quality | 2 | Coverage gates, test generation |
| FinOps | 5 | Azure Cost Management, Infracost |
| **Total** | **15** | **4 domains** |
### File Inventory
| Category | Count |
|----------|-------|
| Agents | 15 |
| Instructions | 3 |
| Prompts | 2 |
| Skills | 2 |
| **Total Validated** | **22** |
EOF