-
-
Notifications
You must be signed in to change notification settings - Fork 1
213 lines (182 loc) · 4.95 KB
/
test-comprehensive.yml
File metadata and controls
213 lines (182 loc) · 4.95 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
name: Comprehensive Test Suite
on:
push:
branches: [main, develop, 'feat/**']
pull_request:
branches: [main, develop]
jobs:
# Unit Tests - Security Rules
test-security-rules:
name: Unit - Security Rules
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4.1.0
with:
persist-credentials: false
- uses: actions/setup-node@v4.0.0
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npx jest test/rules/security-rules.test.ts --coverage
- uses: codecov/codecov-action@v4
with:
files: ./coverage/lcov.info
flags: security-rules
# Unit Tests - Best Practices Rules
test-best-practices:
name: Unit - Best Practices Rules
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4.1.0
with:
persist-credentials: false
- uses: actions/setup-node@v4.0.0
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npx jest test/rules/best-practices-rules.test.ts --coverage
# Unit Tests - Performance Rules
test-performance:
name: Unit - Performance Rules
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4.1.0
with:
persist-credentials: false
- uses: actions/setup-node@v4.0.0
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npx jest test/rules/performance-rules.test.ts --coverage
# Unit Tests - Semantic Comparator
test-semantic:
name: Unit - Semantic Comparator
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4.1.0
with:
persist-credentials: false
- uses: actions/setup-node@v4.0.0
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npx jest test/semantic-comparator.test.ts --coverage
# E2E Tests - CLI
test-e2e:
name: E2E - CLI Commands
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4.1.0
with:
persist-credentials: false
- uses: actions/setup-node@v4.0.0
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npx jest test/e2e/cli.test.ts --testTimeout=30000
# Integration Tests - Real Adapters & Git
test-integration:
name: Integration - Real Adapters & Git Operations
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4.1.0
with:
persist-credentials: false
- uses: actions/setup-node@v4.0.0
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm run build
- name: Run integration tests (real adapters)
run: npx jest test/integration/ --testTimeout=30000 --verbose
continue-on-error: false
# Template Tests
test-templates:
name: Templates Validation
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4.1.0
with:
persist-credentials: false
- uses: actions/setup-node@v4.0.0
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npx jest test/templates/contracts.test.ts --coverage
# Auto-Fix Tests
test-autofix:
name: Auto-Fix with Snapshots
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4.1.0
with:
persist-credentials: false
- uses: actions/setup-node@v4.0.0
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npx jest test/autofix/autofix.test.ts -u
# Dogfooding
dogfood:
name: Self-Validation
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4.1.0
with:
persist-credentials: false
- uses: actions/setup-node@v4.0.0
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm run build
- name: Validate all workflows
run: |
for workflow in .github/workflows/*.yml; do
echo "Validating $workflow..."
node bin/cerber-validate "$workflow" --verbose || echo "⚠️ Issues found"
done
# Final Gate
all-pass:
name: ✅ All Tests Pass
needs: [
test-security-rules,
test-best-practices,
test-performance,
test-semantic,
test-e2e,
test-integration,
test-templates,
test-autofix,
dogfood
]
runs-on: ubuntu-latest
steps:
- run: echo "🎉 All tests passed!"