1+ name : Pull Request Checks
2+
3+ on :
4+ pull_request :
5+ branches : [ main, master, develop ]
6+ types : [ opened, synchronize, reopened ]
7+
8+ jobs :
9+ lint-and-typecheck :
10+ name : Lint and Type Check
11+ runs-on : ubuntu-latest
12+
13+ strategy :
14+ matrix :
15+ node-version : [18.x, 20.x, 22.x]
16+
17+ steps :
18+ - name : Checkout code
19+ uses : actions/checkout@v4
20+
21+ - name : Setup Node.js ${{ matrix.node-version }}
22+ uses : actions/setup-node@v4
23+ with :
24+ node-version : ${{ matrix.node-version }}
25+ cache : ' npm'
26+
27+ - name : Install dependencies
28+ run : npm ci
29+
30+ - name : Run ESLint
31+ run : npm run lint
32+
33+ - name : Run TypeScript type check
34+ run : npm run typecheck
35+
36+ - name : Build project
37+ run : npm run build
38+
39+ test :
40+ name : Run Tests
41+ runs-on : ubuntu-latest
42+ needs : lint-and-typecheck
43+
44+ strategy :
45+ matrix :
46+ node-version : [18.x, 20.x, 22.x]
47+
48+ steps :
49+ - name : Checkout code
50+ uses : actions/checkout@v4
51+
52+ - name : Setup Node.js ${{ matrix.node-version }}
53+ uses : actions/setup-node@v4
54+ with :
55+ node-version : ${{ matrix.node-version }}
56+ cache : ' npm'
57+
58+ - name : Install dependencies
59+ run : npm ci
60+
61+ - name : Run tests
62+ run : npm test --if-present
63+
64+ security-check :
65+ name : Security Check
66+ runs-on : ubuntu-latest
67+
68+ steps :
69+ - name : Checkout code
70+ uses : actions/checkout@v4
71+
72+ - name : Setup Node.js
73+ uses : actions/setup-node@v4
74+ with :
75+ node-version : 20.x
76+ cache : ' npm'
77+
78+ - name : Install dependencies
79+ run : npm ci
80+
81+ - name : Run npm audit
82+ run : npm audit --audit-level=moderate
83+ continue-on-error : true
84+
85+ - name : Check for known vulnerabilities
86+ run : |
87+ npm list --depth=0 || true
88+ echo "Checking for outdated packages..."
89+ npm outdated || true
0 commit comments