-
-
Notifications
You must be signed in to change notification settings - Fork 0
215 lines (202 loc) · 7.27 KB
/
Copy pathcomprehensive-quality.yml
File metadata and controls
215 lines (202 loc) · 7.27 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
214
215
# SPDX-License-Identifier: AGPL-3.0-or-later
name: Comprehensive Quality Gates
on:
push:
branches: [main, master]
pull_request:
schedule:
- cron: '0 5 * * *'
permissions: read-all
jobs:
# DEPENDABILITY - Stability and reliability
dependability:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Check test coverage
run: |
echo "Checking for test files..."
TESTS=$(find . -name "*_test.*" -o -name "test_*" -o -name "*_spec.*" -o -name "*.test.*" | wc -l)
echo "Found $TESTS test files"
if [ "$TESTS" -lt 1 ]; then
echo "::warning::No test files detected"
fi
- name: Check error handling
run: |
# Check for proper error handling patterns
PANICS=$(grep -rE "panic!|unwrap\(\)|expect\(" --include="*.rs" . 2>/dev/null | wc -l || echo "0")
echo "Rust panics/unwraps: $PANICS"
# SECURITY - Multi-layer security scanning
security:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Secret scanning
uses: trufflesecurity/trufflehog@8a8ef8526528d8a4ff3e2c90be08e25ef8efbd9b # v3.88.3
continue-on-error: true
- name: Dependency vulnerabilities
run: |
if [ -f "Cargo.toml" ]; then
cargo install cargo-audit && cargo audit || true
fi
if [ -f "requirements.txt" ]; then
pip install safety && safety check -r requirements.txt || true
fi
- name: SAST scan
uses: returntocorp/semgrep-action@v1
continue-on-error: true
# INTEROPERABILITY - API and format compatibility
interoperability:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Check API specs
run: |
if [ -f "openapi.yaml" ] || [ -f "openapi.json" ]; then
echo "✅ OpenAPI spec found"
fi
if [ -f "schema.graphql" ]; then
echo "✅ GraphQL schema found"
fi
- name: Validate JSON/YAML schemas
run: |
find . -name "*.json" -exec python3 -m json.tool {} \; 2>/dev/null | head -5 || true
# VALIDATION - Input/output validation
validation:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Check for validation patterns
run: |
VALIDATION=$(grep -rE "validate|sanitize|Schema|Validator" --include="*.rs" --include="*.res" --include="*.ex" . 2>/dev/null | wc -l || echo "0")
echo "Validation patterns found: $VALIDATION"
# ATTESTATION - Supply chain integrity (SLSA)
attestation:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
attestations: write
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Generate SBOM
run: |
echo "SBOM generation would run here"
# For Rust: cargo-sbom
# For Node: npm sbom
- name: Check signatures
run: |
if [ -f "CHECKSUMS.txt" ] || [ -f "SHA256SUMS" ]; then
echo "✅ Checksums file present"
fi
# VERIFICATION - Formal methods where applicable
verification:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Check SPARK proofs
run: |
if find . -name "*.ads" | grep -q .; then
echo "Ada/SPARK files found - formal verification applicable"
fi
- name: Type coverage
run: |
if [ -f "rescript.json" ]; then
echo "ReScript provides 100% type coverage"
fi
# FUNCTIONALITY - Feature completeness
functionality:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Check TODOs and FIXMEs
run: |
echo "=== Incomplete items ==="
grep -rn "TODO\|FIXME\|UNIMPLEMENTED\|unimplemented!" . 2>/dev/null | head -20 || echo "None"
- name: Check deprecated usage
run: |
grep -rn "deprecated\|DEPRECATED" . 2>/dev/null | head -10 || echo "No deprecations"
# PERFORMANCE - Benchmarks and profiling
performance:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Check for benchmarks
run: |
BENCHES=$(find . -name "*bench*" -o -name "*perf*" | wc -l)
echo "Benchmark files: $BENCHES"
- name: Binary size check (Rust)
run: |
if [ -f "Cargo.toml" ]; then
cargo build --release 2>/dev/null || true
find target/release -maxdepth 1 -type f -executable -exec ls -lh {} \; 2>/dev/null || true
fi
# ACCESSIBILITY - A11y compliance
accessibility:
runs-on: ubuntu-latest
permissions:
contents: read
if: hashFiles('**/*.html') != ''
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: HTML accessibility check
run: |
echo "Checking for a11y attributes..."
A11Y=$(grep -rE 'aria-|role=|alt=' --include="*.html" . 2>/dev/null | wc -l || echo "0")
echo "A11y attributes found: $A11Y"
- name: Lighthouse (if web project)
run: |
echo "Lighthouse would run on deployed URL"
# LICENSE COMPLIANCE
license:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Check license files
run: |
if [ -f "LICENSE" ] || [ -f "LICENSE.txt" ] || [ -f "LICENSE.md" ]; then
echo "✅ License file present"
head -5 LICENSE* 2>/dev/null
else
echo "::warning::No LICENSE file"
fi
- name: Check SPDX headers
run: |
SPDX=$(grep -rE "SPDX-License-Identifier" . 2>/dev/null | wc -l || echo "0")
echo "Files with SPDX headers: $SPDX"
# DOCUMENTATION QUALITY
documentation:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Check docs completeness
run: |
DOCS=""
[ -f "README.md" ] || [ -f "README.adoc" ] && DOCS="$DOCS README"
[ -f "CONTRIBUTING.md" ] || [ -f "CONTRIBUTING.adoc" ] && DOCS="$DOCS CONTRIBUTING"
[ -f "CHANGELOG.md" ] && DOCS="$DOCS CHANGELOG"
[ -f "SECURITY.md" ] && DOCS="$DOCS SECURITY"
[ -d "docs" ] && DOCS="$DOCS docs/"
echo "Documentation:$DOCS"
- name: Check code comments
run: |
COMMENTS=$(grep -rE "^[[:space:]]*(//|#|/\*)" --include="*.rs" --include="*.res" --include="*.py" . 2>/dev/null | wc -l || echo "0")
echo "Comment lines: $COMMENTS"