1+ name : AuraGlass Design System Compliance
2+
3+ on :
4+ push :
5+ branches : [ main, develop, feat/* ]
6+ pull_request :
7+ branches : [ main, develop ]
8+
9+ jobs :
10+ design-system-compliance :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Checkout code
15+ uses : actions/checkout@v4
16+ with :
17+ fetch-depth : 0 # Needed for git diff
18+
19+ - name : Setup Node.js
20+ uses : actions/setup-node@v4
21+ with :
22+ node-version : ' 18'
23+ cache : ' npm'
24+
25+ - name : Install dependencies
26+ run : npm ci
27+
28+ - name : Run TypeScript check
29+ run : npm run typecheck
30+
31+ - name : Run ESLint (Design System Rules)
32+ run : npm run lint:check
33+
34+ - name : Run Token Linter
35+ run : npm run lint:tokens
36+ continue-on-error : false
37+
38+ - name : Run Style Audit
39+ run : npm run lint:styles
40+ continue-on-error : false
41+
42+ - name : Run Glass Validation
43+ run : npm run glass:validate
44+ continue-on-error : false
45+
46+ - name : Run Glass Contrast Tests
47+ run : npm run test:glass-contrast
48+ continue-on-error : false
49+
50+ - name : Generate Design System Report
51+ run : |
52+ echo "## 🎯 AuraGlass Design System Compliance Report" > design-system-report.md
53+ echo "" >> design-system-report.md
54+ echo "### Token Compliance" >> design-system-report.md
55+ npm run lint:tokens 2>&1 | tee -a design-system-report.md || true
56+ echo "" >> design-system-report.md
57+ echo "### Style Audit" >> design-system-report.md
58+ npm run lint:styles 2>&1 | tee -a design-system-report.md || true
59+ echo "" >> design-system-report.md
60+ echo "### Glass Validation" >> design-system-report.md
61+ npm run glass:validate 2>&1 | tee -a design-system-report.md || true
62+ continue-on-error : true
63+
64+ - name : Upload Design System Report
65+ uses : actions/upload-artifact@v3
66+ if : always()
67+ with :
68+ name : design-system-report
69+ path : design-system-report.md
70+ retention-days : 30
71+
72+ - name : Comment PR with Design System Report
73+ if : github.event_name == 'pull_request'
74+ uses : actions/github-script@v6
75+ with :
76+ script : |
77+ const fs = require('fs');
78+ let report = '';
79+ try {
80+ report = fs.readFileSync('design-system-report.md', 'utf8');
81+ } catch (e) {
82+ report = '## Design System Report\n\nReport generation failed.';
83+ }
84+
85+ github.rest.issues.createComment({
86+ issue_number: context.issue.number,
87+ owner: context.repo.owner,
88+ repo: context.repo.repo,
89+ body: report
90+ });
91+
92+ design-system-score :
93+ runs-on : ubuntu-latest
94+ needs : design-system-compliance
95+ if : always()
96+
97+ steps :
98+ - name : Checkout code
99+ uses : actions/checkout@v4
100+
101+ - name : Setup Node.js
102+ uses : actions/setup-node@v4
103+ with :
104+ node-version : ' 18'
105+ cache : ' npm'
106+
107+ - name : Install dependencies
108+ run : npm ci
109+
110+ - name : Calculate Design System Score
111+ id : score
112+ run : |
113+ # Run all checks and calculate score
114+ TOTAL_CHECKS=5
115+ PASSED_CHECKS=0
116+
117+ # TypeScript check (20 points)
118+ if npm run typecheck; then
119+ PASSED_CHECKS=$((PASSED_CHECKS + 1))
120+ echo "✅ TypeScript: PASS"
121+ else
122+ echo "❌ TypeScript: FAIL"
123+ fi
124+
125+ # ESLint check (20 points)
126+ if npm run lint:check; then
127+ PASSED_CHECKS=$((PASSED_CHECKS + 1))
128+ echo "✅ ESLint: PASS"
129+ else
130+ echo "❌ ESLint: FAIL"
131+ fi
132+
133+ # Token compliance (20 points)
134+ if npm run lint:tokens; then
135+ PASSED_CHECKS=$((PASSED_CHECKS + 1))
136+ echo "✅ Token Compliance: PASS"
137+ else
138+ echo "❌ Token Compliance: FAIL"
139+ fi
140+
141+ # Style audit (20 points)
142+ if npm run lint:styles; then
143+ PASSED_CHECKS=$((PASSED_CHECKS + 1))
144+ echo "✅ Style Audit: PASS"
145+ else
146+ echo "❌ Style Audit: FAIL"
147+ fi
148+
149+ # Glass validation (20 points)
150+ if npm run glass:validate; then
151+ PASSED_CHECKS=$((PASSED_CHECKS + 1))
152+ echo "✅ Glass Validation: PASS"
153+ else
154+ echo "❌ Glass Validation: FAIL"
155+ fi
156+
157+ SCORE=$((PASSED_CHECKS * 20))
158+ echo "score=$SCORE" >> $GITHUB_OUTPUT
159+ echo "passed=$PASSED_CHECKS" >> $GITHUB_OUTPUT
160+ echo "total=$TOTAL_CHECKS" >> $GITHUB_OUTPUT
161+
162+ echo "🎯 Design System Score: $SCORE/100"
163+
164+ if [ $SCORE -eq 100 ]; then
165+ echo "🏆 Perfect design system compliance!"
166+ elif [ $SCORE -ge 80 ]; then
167+ echo "🎉 Excellent design system compliance!"
168+ elif [ $SCORE -ge 60 ]; then
169+ echo "⚠️ Good design system compliance, room for improvement"
170+ else
171+ echo "❌ Design system compliance needs attention"
172+ exit 1
173+ fi
174+
175+ - name : Create Status Badge
176+ run : |
177+ SCORE=${{ steps.score.outputs.score }}
178+ if [ $SCORE -eq 100 ]; then
179+ COLOR="brightgreen"
180+ MESSAGE="100%25%20perfect"
181+ elif [ $SCORE -ge 80 ]; then
182+ COLOR="green"
183+ MESSAGE="$SCORE%25%20excellent"
184+ elif [ $SCORE -ge 60 ]; then
185+ COLOR="yellow"
186+ MESSAGE="$SCORE%25%20good"
187+ else
188+ COLOR="red"
189+ MESSAGE="$SCORE%25%20needs%20work"
190+ fi
191+
192+ echo "Badge: https://img.shields.io/badge/Design%20System-$MESSAGE-$COLOR"
0 commit comments