-
Notifications
You must be signed in to change notification settings - Fork 5
196 lines (165 loc) · 6.33 KB
/
ci-pipeline.yml
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
name: OctoDocs CI Pipeline
on:
pull_request:
branches:
- develop
push:
branches:
- develop
jobs:
setup-backend:
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.cache-backend-deps.outputs.cache-hit }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "23"
# 백엔드 의존성 캐시 설정
- name: Cache Yarn dependencies for backend
id: cache-backend-deps
uses: actions/cache@v3
with:
path: backend/node_modules
key: ${{ runner.os }}-backend-yarn-${{ hashFiles('backend/yarn.lock') }}
# 백엔드 의존성 설치
- name: Install backend dependencies
if: steps.cache-backend-deps.outputs.cache-hit != 'true'
working-directory: ./backend
run: yarn install
setup-frontend:
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.cache-frontend-deps.outputs.cache-hit }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "23"
# 프론트엔드 의존성 캐시 설정
- name: Cache Yarn dependencies for frontend
id: cache-frontend-deps
uses: actions/cache@v3
with:
path: frontend/node_modules
key: ${{ runner.os }}-frontend-yarn-${{ hashFiles('frontend/yarn.lock') }}
# 프론트엔드 의존성 설치
- name: Install frontend dependencies
if: steps.cache-frontend-deps.outputs.cache-hit != 'true'
working-directory: ./frontend
run: yarn install
backend-lint:
runs-on: ubuntu-latest
needs: setup-backend
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "23"
# 백엔드 의존성 캐시 복원
- name: Restore Yarn dependencies for backend
uses: actions/cache@v3
with:
path: backend/node_modules
key: ${{ runner.os }}-backend-yarn-${{ hashFiles('backend/yarn.lock') }}
# 백엔드 린트 실행
- name: Run backend lint
working-directory: ./backend
run: yarn lint
continue-on-error: true
# 백엔드 린트 경고 포스트
- name: Post backend lint warning if any
if: failure()
run: echo "⚠️ 백엔드 lint 실행 도중 경고가 발생했습니다. 확인해주세요."
frontend-lint:
runs-on: ubuntu-latest
needs: setup-frontend
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "23"
# 프론트엔드 의존성 캐시 복원
- name: Restore Yarn dependencies for frontend
uses: actions/cache@v3
with:
path: frontend/node_modules
key: ${{ runner.os }}-frontend-yarn-${{ hashFiles('frontend/yarn.lock') }}
# 프론트엔드 린트 실행
- name: Run frontend lint
working-directory: ./frontend
run: yarn lint
continue-on-error: true
# 프론트엔드 린트 경고 포스트
- name: Post frontend lint warning if any
if: failure()
run: echo "⚠️ 프론트엔드 lint 실행 도중 경고가 발생했습니다. 확인해주세요."
backend-build:
runs-on: ubuntu-latest
needs: setup-backend
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "23"
# 백엔드 의존성 캐시 복원
- name: Restore Yarn dependencies for backend
uses: actions/cache@v3
with:
path: backend/node_modules
key: ${{ runner.os }}-backend-yarn-${{ hashFiles('backend/yarn.lock') }}
# 백엔드 빌드 실행
- name: Run backend build
working-directory: ./backend
run: yarn build
frontend-build:
runs-on: ubuntu-latest
needs: setup-frontend
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "23"
# 프론트엔드 의존성 캐시 복원
- name: Restore Yarn dependencies for frontend
uses: actions/cache@v3
with:
path: frontend/node_modules
key: ${{ runner.os }}-frontend-yarn-${{ hashFiles('frontend/yarn.lock') }}
# 프론트엔드 빌드 실행
- name: Run frontend build
working-directory: ./frontend
run: yarn build
backend-test:
runs-on: ubuntu-latest
needs: [setup-backend, backend-build]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "23"
# 백엔드 의존성 캐시 복원
- name: Restore Yarn dependencies for backend
uses: actions/cache@v3
with:
path: backend/node_modules
key: ${{ runner.os }}-backend-yarn-${{ hashFiles('backend/yarn.lock') }}
# 백엔드 테스트 실행
- name: Run backend tests
working-directory: ./backend
run: yarn test