Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

ci: add npm audit, coverage threshold, dashboard CI, and Dependabot

rmyndharis997b76fd5462
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 000000000..a19d965ac
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,30 @@
+version: 2
+updates:
+ - package-ecosystem: npm
+ directory: /
+ schedule:
+ interval: weekly
+ day: monday
+ open-pull-requests-limit: 10
+ groups:
+ minor-and-patch:
+ update-types:
+ - minor
+ - patch
+
+ - package-ecosystem: npm
+ directory: /dashboard
+ schedule:
+ interval: weekly
+ day: monday
+ open-pull-requests-limit: 5
+ groups:
+ minor-and-patch:
+ update-types:
+ - minor
+ - patch
+
+ - package-ecosystem: github-actions
+ directory: /
+ schedule:
+ interval: monthly
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 00ec83641..4bc769ba2 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -25,6 +25,9 @@ jobs:
- name: Install dependencies
run: npm ci
+ - name: Security audit
+ run: npm audit --audit-level=high
+
- name: Run ESLint
run: npm run lint
@@ -56,10 +59,32 @@ jobs:
files: ./coverage/lcov.info
fail_ci_if_error: false
+ dashboard:
+ name: Dashboard
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: ${{ env.NODE_VERSION }}
+ cache: 'npm'
+ cache-dependency-path: dashboard/package-lock.json
+
+ - name: Install dependencies
+ run: cd dashboard && npm ci
+
+ - name: Run ESLint
+ run: cd dashboard && npm run lint
+
+ - name: Build dashboard
+ run: cd dashboard && npm run build
+
build:
name: Build
runs-on: ubuntu-latest
- needs: [lint, test]
+ needs: [lint, test, dashboard]
steps:
- uses: actions/checkout@v4
diff --git a/package.json b/package.json
index 8d4797187..bdedd5c55 100644
--- a/package.json
+++ b/package.json
@@ -109,6 +109,14 @@
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
+ "coverageThreshold": {
+ "global": {
+ "branches": 10,
+ "functions": 12,
+ "lines": 15,
+ "statements": 15
+ }
+ },
"testEnvironment": "node"
}
}
\ No newline at end of file