|
1 | 1 | name: OctoDocs CI Pipeline |
2 | 2 |
|
3 | 3 | on: |
4 | | - pull_request: |
5 | | - branches: |
6 | | - - develop |
7 | | - push: |
8 | | - branches: |
9 | | - - develop |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - develop |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - develop |
10 | 10 |
|
11 | 11 | jobs: |
12 | | - setup-backend: |
13 | | - runs-on: ubuntu-latest |
14 | | - outputs: |
15 | | - cache-key: ${{ steps.cache-backend-deps.outputs.cache-hit }} |
16 | | - steps: |
17 | | - - name: Checkout repository |
18 | | - uses: actions/checkout@v3 |
19 | | - |
20 | | - - name: Set up Node.js |
21 | | - uses: actions/setup-node@v3 |
22 | | - with: |
23 | | - node-version: "23" |
24 | | - |
25 | | - # 백엔드 의존성 캐시 설정 |
26 | | - - name: Cache Yarn dependencies for backend |
27 | | - id: cache-backend-deps |
28 | | - uses: actions/cache@v3 |
29 | | - with: |
30 | | - path: backend/node_modules |
31 | | - key: ${{ runner.os }}-backend-yarn-${{ hashFiles('backend/yarn.lock') }} |
32 | | - |
33 | | - # 백엔드 의존성 설치 |
34 | | - - name: Install backend dependencies |
35 | | - if: steps.cache-backend-deps.outputs.cache-hit != 'true' |
36 | | - working-directory: ./backend |
37 | | - run: yarn install |
38 | | - |
39 | | - setup-frontend: |
40 | | - runs-on: ubuntu-latest |
41 | | - outputs: |
42 | | - cache-key: ${{ steps.cache-frontend-deps.outputs.cache-hit }} |
43 | | - steps: |
44 | | - - name: Checkout repository |
45 | | - uses: actions/checkout@v3 |
46 | | - |
47 | | - - name: Set up Node.js |
48 | | - uses: actions/setup-node@v3 |
49 | | - with: |
50 | | - node-version: "23" |
51 | | - |
52 | | - # 프론트엔드 의존성 캐시 설정 |
53 | | - - name: Cache Yarn dependencies for frontend |
54 | | - id: cache-frontend-deps |
55 | | - uses: actions/cache@v3 |
56 | | - with: |
57 | | - path: frontend/node_modules |
58 | | - key: ${{ runner.os }}-frontend-yarn-${{ hashFiles('frontend/yarn.lock') }} |
59 | | - |
60 | | - # 프론트엔드 의존성 설치 |
61 | | - - name: Install frontend dependencies |
62 | | - if: steps.cache-frontend-deps.outputs.cache-hit != 'true' |
63 | | - working-directory: ./frontend |
64 | | - run: yarn install |
65 | | - |
66 | | - backend-lint: |
67 | | - runs-on: ubuntu-latest |
68 | | - needs: setup-backend |
69 | | - steps: |
70 | | - - name: Checkout repository |
71 | | - uses: actions/checkout@v3 |
72 | | - |
73 | | - - name: Set up Node.js |
74 | | - uses: actions/setup-node@v3 |
75 | | - with: |
76 | | - node-version: "23" |
77 | | - |
78 | | - # 백엔드 의존성 캐시 복원 |
79 | | - - name: Restore Yarn dependencies for backend |
80 | | - uses: actions/cache@v3 |
81 | | - with: |
82 | | - path: backend/node_modules |
83 | | - key: ${{ runner.os }}-backend-yarn-${{ hashFiles('backend/yarn.lock') }} |
84 | | - |
85 | | - # 백엔드 린트 실행 |
86 | | - - name: Run backend lint |
87 | | - working-directory: ./backend |
88 | | - run: yarn lint |
89 | | - continue-on-error: true |
90 | | - |
91 | | - # 백엔드 린트 경고 포스트 |
92 | | - - name: Post backend lint warning if any |
93 | | - if: failure() |
94 | | - run: echo "⚠️ 백엔드 lint 실행 도중 경고가 발생했습니다. 확인해주세요." |
95 | | - |
96 | | - frontend-lint: |
97 | | - runs-on: ubuntu-latest |
98 | | - needs: setup-frontend |
99 | | - steps: |
100 | | - - name: Checkout repository |
101 | | - uses: actions/checkout@v3 |
102 | | - |
103 | | - - name: Set up Node.js |
104 | | - uses: actions/setup-node@v3 |
105 | | - with: |
106 | | - node-version: "23" |
107 | | - |
108 | | - # 프론트엔드 의존성 캐시 복원 |
109 | | - - name: Restore Yarn dependencies for frontend |
110 | | - uses: actions/cache@v3 |
111 | | - with: |
112 | | - path: frontend/node_modules |
113 | | - key: ${{ runner.os }}-frontend-yarn-${{ hashFiles('frontend/yarn.lock') }} |
114 | | - |
115 | | - # 프론트엔드 린트 실행 |
116 | | - - name: Run frontend lint |
117 | | - working-directory: ./frontend |
118 | | - run: yarn lint |
119 | | - continue-on-error: true |
120 | | - |
121 | | - # 프론트엔드 린트 경고 포스트 |
122 | | - - name: Post frontend lint warning if any |
123 | | - if: failure() |
124 | | - run: echo "⚠️ 프론트엔드 lint 실행 도중 경고가 발생했습니다. 확인해주세요." |
125 | | - |
126 | | - backend-build: |
127 | | - runs-on: ubuntu-latest |
128 | | - needs: setup-backend |
129 | | - steps: |
130 | | - - name: Checkout repository |
131 | | - uses: actions/checkout@v3 |
132 | | - |
133 | | - - name: Set up Node.js |
134 | | - uses: actions/setup-node@v3 |
135 | | - with: |
136 | | - node-version: "23" |
137 | | - |
138 | | - # 백엔드 의존성 캐시 복원 |
139 | | - - name: Restore Yarn dependencies for backend |
140 | | - uses: actions/cache@v3 |
141 | | - with: |
142 | | - path: backend/node_modules |
143 | | - key: ${{ runner.os }}-backend-yarn-${{ hashFiles('backend/yarn.lock') }} |
144 | | - |
145 | | - # 백엔드 빌드 실행 |
146 | | - - name: Run backend build |
147 | | - working-directory: ./backend |
148 | | - run: yarn build |
149 | | - |
150 | | - frontend-build: |
151 | | - runs-on: ubuntu-latest |
152 | | - needs: setup-frontend |
153 | | - steps: |
154 | | - - name: Checkout repository |
155 | | - uses: actions/checkout@v3 |
156 | | - |
157 | | - - name: Set up Node.js |
158 | | - uses: actions/setup-node@v3 |
159 | | - with: |
160 | | - node-version: "23" |
161 | | - |
162 | | - # 프론트엔드 의존성 캐시 복원 |
163 | | - - name: Restore Yarn dependencies for frontend |
164 | | - uses: actions/cache@v3 |
165 | | - with: |
166 | | - path: frontend/node_modules |
167 | | - key: ${{ runner.os }}-frontend-yarn-${{ hashFiles('frontend/yarn.lock') }} |
168 | | - |
169 | | - # 프론트엔드 빌드 실행 |
170 | | - - name: Run frontend build |
171 | | - working-directory: ./frontend |
172 | | - run: yarn build |
173 | | - |
174 | | - backend-test: |
175 | | - runs-on: ubuntu-latest |
176 | | - needs: [setup-backend, backend-build] |
177 | | - steps: |
178 | | - - name: Checkout repository |
179 | | - uses: actions/checkout@v3 |
180 | | - |
181 | | - - name: Set up Node.js |
182 | | - uses: actions/setup-node@v3 |
183 | | - with: |
184 | | - node-version: "23" |
185 | | - |
186 | | - # 백엔드 의존성 캐시 복원 |
187 | | - - name: Restore Yarn dependencies for backend |
188 | | - uses: actions/cache@v3 |
189 | | - with: |
190 | | - path: backend/node_modules |
191 | | - key: ${{ runner.os }}-backend-yarn-${{ hashFiles('backend/yarn.lock') }} |
192 | | - |
193 | | - # 백엔드 테스트 실행 |
194 | | - - name: Run backend tests |
195 | | - working-directory: ./backend |
196 | | - run: yarn test |
| 12 | + setup: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + outputs: |
| 15 | + cache-key: ${{ steps.cache-backend-deps.outputs.cache-hit }} |
| 16 | + steps: |
| 17 | + - name: Checkout repository |
| 18 | + uses: actions/checkout@v3 |
| 19 | + |
| 20 | + - name: Set up Node.js |
| 21 | + uses: actions/setup-node@v3 |
| 22 | + with: |
| 23 | + node-version: "23" |
| 24 | + |
| 25 | + # turbo 의존성 캐시 설정 |
| 26 | + - name: Cache Yarn dependencies for backend |
| 27 | + id: cache-deps |
| 28 | + uses: actions/cache@v3 |
| 29 | + with: |
| 30 | + path: node_modules |
| 31 | + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} |
| 32 | + |
| 33 | + # turbo 의존성 설치 |
| 34 | + - name: Install backend dependencies |
| 35 | + if: steps.cache-deps.outputs.cache-hit != 'true' |
| 36 | + run: yarn install |
| 37 | + |
| 38 | + lint: |
| 39 | + runs-on: ubuntu-latest |
| 40 | + needs: setup |
| 41 | + steps: |
| 42 | + - name: Checkout repository |
| 43 | + uses: actions/checkout@v3 |
| 44 | + |
| 45 | + - name: Set up Node.js |
| 46 | + uses: actions/setup-node@v3 |
| 47 | + with: |
| 48 | + node-version: "23" |
| 49 | + |
| 50 | + # 의존성 캐시 복원 |
| 51 | + - name: Restore Yarn dependencies for backend |
| 52 | + uses: actions/cache@v3 |
| 53 | + with: |
| 54 | + path: node_modules |
| 55 | + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} |
| 56 | + |
| 57 | + # 백엔드 린트 실행 |
| 58 | + - name: Run lint |
| 59 | + run: yarn lint |
| 60 | + continue-on-error: true |
| 61 | + |
| 62 | + # 백엔드 린트 경고 포스트 |
| 63 | + - name: Post backend lint warning if any |
| 64 | + if: failure() |
| 65 | + run: echo "⚠️ lint 실행 도중 경고가 발생했습니다. 확인해주세요." |
| 66 | + |
| 67 | + build: |
| 68 | + runs-on: ubuntu-latest |
| 69 | + needs: setup |
| 70 | + steps: |
| 71 | + - name: Checkout repository |
| 72 | + uses: actions/checkout@v3 |
| 73 | + |
| 74 | + - name: Set up Node.js |
| 75 | + uses: actions/setup-node@v3 |
| 76 | + with: |
| 77 | + node-version: "23" |
| 78 | + # 루트 의존성 캐시 설정 |
| 79 | + - name: Cache Yarn dependencies for root |
| 80 | + id: cache-deps |
| 81 | + uses: actions/cache@v3 |
| 82 | + with: |
| 83 | + path: node_modules |
| 84 | + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} |
| 85 | + |
| 86 | + # 빌드 실행 |
| 87 | + - name: Run build |
| 88 | + run: yarn build |
| 89 | + test: |
| 90 | + runs-on: ubuntu-latest |
| 91 | + needs: [setup, build] |
| 92 | + steps: |
| 93 | + - name: Checkout repository |
| 94 | + uses: actions/checkout@v3 |
| 95 | + |
| 96 | + - name: Set up Node.js |
| 97 | + uses: actions/setup-node@v3 |
| 98 | + with: |
| 99 | + node-version: "23" |
| 100 | + |
| 101 | + # 의존성 캐시 복원 |
| 102 | + - name: Restore Yarn dependencies |
| 103 | + uses: actions/cache@v3 |
| 104 | + with: |
| 105 | + path: node_modules |
| 106 | + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} |
| 107 | + |
| 108 | + # 테스트 실행 |
| 109 | + - name: Run tests |
| 110 | + run: yarn test |
0 commit comments