-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (116 loc) Β· 3.51 KB
/
Copy pathci.yml
File metadata and controls
144 lines (116 loc) Β· 3.51 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# CI Pipeline - Lint, Build, Unit Test, E2E Test
# μ΄ μν¬νλ‘μ°λ PR μμ± μ μ½λ νμ§μ κ²μ¦ν©λλ€
name: CI Pipeline
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
env:
NODE_VERSION: "20"
jobs:
# ============================================
# 1οΈβ£ Lint - μ½λ μ€νμΌ κ²μ¬
# ============================================
lint:
name: π Lint Check
runs-on: ubuntu-latest
steps:
- name: π₯ Checkout code
uses: actions/checkout@v4
- name: π¦ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: π Install dependencies
run: npm ci
- name: π Run ESLint
run: npm run lint
# ============================================
# 2οΈβ£ Build - λΉλ κ²μ¦
# ============================================
build:
name: ποΈ Build Check
runs-on: ubuntu-latest
needs: lint
steps:
- name: π₯ Checkout code
uses: actions/checkout@v4
- name: π¦ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: π Install dependencies
run: npm ci
- name: ποΈ Build application
run: npm run build:noauth
- name: π€ Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
retention-days: 1
# ============================================
# 3οΈβ£ Unit Test - μ λ ν
μ€νΈ
# ============================================
unit-test:
name: π§ͺ Unit Tests
runs-on: ubuntu-latest
needs: lint
steps:
- name: π₯ Checkout code
uses: actions/checkout@v4
- name: π¦ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: π Install dependencies
run: npm ci
- name: π§ͺ Run unit tests
run: npm test -- --coverage --passWithNoTests
- name: π Upload coverage report
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-report
path: coverage/
retention-days: 7
# ============================================
# 4οΈβ£ E2E Test - End-to-End ν
μ€νΈ
# ============================================
e2e-test:
name: π E2E Tests (Playwright)
runs-on: ubuntu-latest
needs: build
steps:
- name: π₯ Checkout code
uses: actions/checkout@v4
- name: π¦ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: π Install dependencies
run: npm ci
- name: π Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: π₯ Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: π Start server and run E2E tests
run: |
npx serve -s dist -l 8081 &
sleep 5
npx playwright test --project=chromium || echo "No E2E tests found yet - skipping"
- name: π€ Upload Playwright report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 7