From 27214b02c13508c014fa5ed23c46a569ff2c4aee Mon Sep 17 00:00:00 2001 From: Tom Boullay Date: Wed, 15 Apr 2026 11:17:48 +0200 Subject: [PATCH] update: add more CI --- .github/workflows/{ci.yml => lint.yml} | 2 +- .github/workflows/quality.yml | 82 ++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 1 deletion(-) rename .github/workflows/{ci.yml => lint.yml} (99%) create mode 100644 .github/workflows/quality.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/lint.yml similarity index 99% rename from .github/workflows/ci.yml rename to .github/workflows/lint.yml index d5fb477..cc775b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: 🔍 CI +name: 🔍 Lint on: pull_request: diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml new file mode 100644 index 0000000..14ffbd3 --- /dev/null +++ b/.github/workflows/quality.yml @@ -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"