update: add more CI
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
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"
|
||||
Reference in New Issue
Block a user