83 lines
1.8 KiB
YAML
83 lines
1.8 KiB
YAML
name: 📊 Quality
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
security:
|
|
name: 🔒 Security Audit
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: ⬇️ Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: 🧰 Setup Node
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: "20"
|
|
cache: npm
|
|
|
|
- name: 📥 Install
|
|
run: npm ci
|
|
|
|
- name: 🔒 Audit
|
|
run: npm audit --audit-level=high
|
|
continue-on-error: true
|
|
|
|
dependencies:
|
|
name: 📋 Dependency Freshness
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: ⬇️ Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: 🧰 Setup Node
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: "20"
|
|
cache: npm
|
|
|
|
- name: 📥 Install
|
|
run: npm ci
|
|
|
|
- name: 📋 Check outdated
|
|
run: npm outdated --depth=0
|
|
continue-on-error: true
|
|
|
|
bundle-size:
|
|
name: 📦 Bundle Size
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: ⬇️ Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: 🧰 Setup Node
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: "20"
|
|
cache: npm
|
|
|
|
- name: 📥 Install
|
|
run: npm ci
|
|
|
|
- name: 📦 Build
|
|
run: npm run build
|
|
|
|
- name: 📏 Check bundle size
|
|
run: |
|
|
# Get bundle size in KB
|
|
SIZE=$(du -k dist | cut -f1)
|
|
echo "Bundle size: ${SIZE}KB"
|
|
|
|
# Threshold: 1000KB (configurable)
|
|
THRESHOLD=1000
|
|
|
|
if [ "$SIZE" -gt "$THRESHOLD" ]; then
|
|
echo "❌ Bundle size ${SIZE}KB exceeds threshold ${THRESHOLD}KB"
|
|
exit 1
|
|
fi
|
|
echo "✅ Bundle size ${SIZE}KB is under threshold"
|