Repository navigation
159 lines (130 loc) · 4.84 KB
/
Copy pathci.yml
File metadata and controls
159 lines (130 loc) · 4.84 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: CI
# 기본 브랜치는 dev 다(origin/HEAD -> origin/dev). 이전 lint.yml 은 트리거가
# main/develop 이라 한 번도 실행되지 않았고, 그 사이 dev 에 eslint 에러와
# 의존성 취약점이 그대로 쌓였다. 트리거를 실제 브랜치에 맞추고 레이어별
# 테스트까지 함께 돌린다.
on:
pull_request:
branches: [dev, main]
push:
branches: [dev, main]
# 같은 브랜치에 연속 push 하면 이전 실행은 취소한다(러너 점유 방지).
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
frontend:
name: Frontend (lint · types · test · build)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: frontend/.nvmrc
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install
working-directory: ./frontend
run: npm ci
- name: Lint
working-directory: ./frontend
run: npm run lint
- name: Type check
working-directory: ./frontend
run: npm run type-check
- name: Test
working-directory: ./frontend
run: npm run test
# 타입체크가 통과해도 번들 단계에서 깨지는 경우(정적 자산·플러그인)를 잡는다.
- name: Build
working-directory: ./frontend
run: npm run build
backend:
name: Backend (Core, Spring)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
cache: gradle
# checkstyle 은 build.gradle 에 플러그인이 없어 태스크 자체가 없다.
# 도입하는 PR 에서 이 잡에 단계를 추가한다.
- name: Test
working-directory: ./backend
run: ./gradlew test --no-daemon
- name: Upload test report
if: failure()
uses: actions/upload-artifact@v4
with:
name: backend-test-report
path: backend/build/reports/tests/test
ai:
name: AI (FastAPI/LangChain)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install
working-directory: ./ai
run: uv sync --extra dev
- name: Lint (flake8)
working-directory: ./ai
run: uv run flake8 .
- name: Format check (black)
working-directory: ./ai
run: uv run black --check .
- name: Test
working-directory: ./ai
run: uv run pytest -q
realtime:
name: RealTime (Go)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Go 코드는 realtime/ 에 있다. 이전 워크플로는 ./backend 에서 실행해
# go.mod 가 없어 조용히 통과했고, realtime 은 검증된 적이 없다.
- uses: actions/setup-go@v5
with:
go-version-file: realtime/go.mod
cache-dependency-path: realtime/go.sum
- name: Build
working-directory: ./realtime
run: go build ./...
- name: Vet
working-directory: ./realtime
run: go vet ./...
# -race 로 돌린다. RealTime 은 본업이 동시 fan-out(AMQP 컨슈머가 Dispatch 하는 동안
# HTTP 핸들러들이 Subscribe/Unsubscribe)이라, 경합은 여기서 못 잡으면 운영에서
# 간헐적 패닉·유실로만 드러난다. realtime/CLAUDE.md §11 도 -race 를 규정한다.
- name: Test
working-directory: ./realtime
run: go test -race ./...
infra:
name: Infra (ops 스크립트)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# 운영 알림·헬스 감시는 셸이라 컴파일러도 타입체커도 없다. 그런데 이 스크립트들은
# **조용히 깨지는 종류**다 — 만드는 동안 실제로 두 번 깨졌고 둘 다 눈에 안 띄었다:
# · 임베디드 파이썬 따옴표가 깨져 판정이 빈 값 → 감시가 그냥 통과
# · `[ -n "$x" ] && notify` 단락으로 정상인데 exit 1 → cron 이 실패로 봄
# selftest 는 로컬 수신기로만 보낸다(팀 채널로 아무것도 나가지 않는다).
- name: Shell syntax
run: |
for f in infra/ops/*.sh infra/backup/backup.sh; do
bash -n "$f" || exit 1
done
- name: ShellCheck
run: |
sudo apt-get update -qq && sudo apt-get install -y -qq shellcheck
shellcheck -S warning infra/ops/notify.sh infra/ops/health-check.sh \
infra/ops/selftest.sh infra/backup/backup.sh
- name: Self test
run: bash infra/ops/selftest.sh