-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (38 loc) · 1.12 KB
/
ci.yml
File metadata and controls
48 lines (38 loc) · 1.12 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
45
46
47
48
name: CI/CD Pipeline
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
NODE_VERSION: '22'
CACHE_DEPENDENCY_PATH: 'package-lock.json'
jobs:
test:
name: 🧪 Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
test-type: [unit]
steps:
- name: 📥 Checkout code
uses: actions/checkout@v5
- name: 🟢 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: ${{ env.CACHE_DEPENDENCY_PATH }}
- name: 📦 Install dependencies
run: npm ci --prefer-offline --no-audit
- name: 🏗️ Build project
run: npm run build
- name: 🧪 Run ${{ matrix.test-type }} tests
run: npm run test:${{ matrix.test-type }}
- name: 📊 PR Test Summary
run: |
echo "## 🧪 Test Results" >> $GITHUB_STEP_SUMMARY
echo "✅ Build: Successful" >> $GITHUB_STEP_SUMMARY
echo "✅ Unit Tests: Passed" >> $GITHUB_STEP_SUMMARY