-
-
Notifications
You must be signed in to change notification settings - Fork 419
Expand file tree
/
Copy pathtest-ci-locally.sh
More file actions
executable file
·44 lines (32 loc) · 1.03 KB
/
test-ci-locally.sh
File metadata and controls
executable file
·44 lines (32 loc) · 1.03 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
#!/bin/bash
# Script to test CI pipeline locally before pushing
# This simulates what GitHub Actions will do
set -e
echo "🚀 Testing CI pipeline locally..."
cd server
echo "📦 Installing dependencies..."
npm ci
echo "🔍 Running ESLint..."
npm run lint
echo "📊 Running npm audit..."
npm audit --audit-level=high || echo "⚠️ Audit found issues but continuing..."
echo "🐳 Testing with MySQL containers..."
export CB_DB_DIALECT_DEV=mysql
export FORCE_CONTAINERS=true
npm run test:run
echo "🐘 Testing with PostgreSQL containers..."
export CB_DB_DIALECT_DEV=postgres
export FORCE_CONTAINERS=true
npm run test:run
echo "📈 Generating coverage report..."
export CB_DB_DIALECT_DEV=mysql
export FORCE_CONTAINERS=true
npm run test:coverage
echo "🗂️ Testing SQLite fallback..."
export CB_DB_DIALECT_DEV=sqlite
export FORCE_CONTAINERS=false
npm run test:run
echo "✅ All CI tests passed locally!"
echo ""
echo "Coverage report available at: server/coverage/index.html"
echo "You can now safely push to trigger GitHub Actions."