-
Notifications
You must be signed in to change notification settings - Fork 3
110 lines (94 loc) · 2.66 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
name: OctoDocs CI Pipeline
on:
pull_request:
branches:
- develop
push:
branches:
- develop
jobs:
setup:
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"
# turbo 의존성 캐시 설정
- name: Cache Yarn dependencies for backend
id: cache-deps
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
# turbo 의존성 설치
- name: Install backend dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: yarn install
lint:
runs-on: ubuntu-latest
needs: setup
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: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
# 백엔드 린트 실행
- name: Run lint
run: yarn lint
continue-on-error: true
# 백엔드 린트 경고 포스트
- name: Post backend lint warning if any
if: failure()
run: echo "⚠️ lint 실행 도중 경고가 발생했습니다. 확인해주세요."
build:
runs-on: ubuntu-latest
needs: setup
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 root
id: cache-deps
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
# 빌드 실행
- name: Run build
run: yarn build
test:
runs-on: ubuntu-latest
needs: [setup, 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
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
# 테스트 실행
- name: Run tests
run: yarn test