forked from bettergovph/petition
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 1.72 KB
/
code-quality.yml
File metadata and controls
65 lines (54 loc) · 1.72 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
name: Code Quality Checks
on:
workflow_run:
workflows: ['CI Pipeline']
types: [completed]
branches: [main, develop]
jobs:
code-quality:
name: Code Quality Analysis
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run comprehensive linting
run: |
npm run lint
npm run format:check
- name: TypeScript strict check
run: npx tsc --noEmit --strict
- name: Build verification
run: npm run build
- name: Security audit
run: npm run security:audit
- name: Dependency analysis
run: |
npm run deps:check
npm run deps:outdated
- name: Check for console.log statements
run: |
if grep -r "console\.log" src/ --include="*.ts" --include="*.tsx"; then
echo "Warning: console.log statements found in source code"
echo "Consider removing them before production deployment"
else
echo "No console.log statements found"
fi
- name: Check for TODO/FIXME comments
run: |
echo "Checking for TODO/FIXME comments..."
if grep -r "TODO\|FIXME" src/ --include="*.ts" --include="*.tsx"; then
echo "Found TODO/FIXME comments in source code"
echo "Consider addressing these before merging"
else
echo "No TODO/FIXME comments found"
fi