Repository navigation
152 lines (136 loc) · 5.48 KB
/
Copy pathci.yml
File metadata and controls
152 lines (136 loc) · 5.48 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
name: CI
on:
pull_request:
push:
branches: [develop]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
demo-scripts:
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- name: Check out repository
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Test demo decisions without external services
run: python3 -m unittest discover -s scripts/demo -p 'test_*.py' -v
recovery-contract:
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- name: Check out repository
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Test isolated recovery decisions without cloud access
run: |
python3 -m unittest discover -s scripts/opensql -p 'test_dr_recovery.py' -v
python3 -m unittest discover -s scripts/opensql -p 'test_barman_offsite_sync.py' -v
backend:
runs-on: ubuntu-latest
timeout-minutes: 15
services:
# test 프로필 기본 접속값(localhost:55432, app/local_password)에 맞춘다.
# OpenSqlCompatibilityIntegrationTest가 서버 17.8·pgvector 0.8.1을 단언하므로 태그가 아닌 digest로 고정한다.
postgres:
image: pgvector/pgvector:0.8.1-pg17@sha256:3e8b3adfd27b5707128f60956f62a793c3c9326ea8cfaf0eab7adccb5d700b21
env:
POSTGRES_DB: app
POSTGRES_USER: app
POSTGRES_PASSWORD: local_password
ports:
- 55432:5432
options: >-
--health-cmd "pg_isready -U app -d app"
--health-interval 5s
--health-timeout 5s
--health-retries 20
# 로그아웃 블랙리스트·STOMP 역할 회수 통합 테스트가 실제 Redis 프로토콜 서버를 사용한다.
valkey:
image: valkey/valkey:9.1-alpine
ports:
- 6379:6379
options: >-
--health-cmd "valkey-cli ping"
--health-interval 5s
--health-timeout 5s
--health-retries 20
env:
# CI 전용 서명 키다. 운영·로컬 시크릿과 무관하다.
JWT_SECRET: docgrid-ci-test-only-jwt-secret-not-for-production
REDIS_HOST: localhost
REDIS_PORT: 6379
# 여러 Spring Context의 연결 풀 합계가 PostgreSQL max_connections(100)를 넘지 않게 한다.
SPRING_DATASOURCE_HIKARI_MAXIMUM_POOL_SIZE: 3
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Set up Java 17
uses: actions/setup-java@v6
with:
distribution: temurin
java-version: "17"
cache: gradle
# 로컬은 docker/postgres/init/001-enable-vector.sql이 만드는 확장을 Flyway 실행 전에 준비한다.
- name: Enable pgvector extension
run: |
docker exec ${{ job.services.postgres.id }} psql -U app -d app -v ON_ERROR_STOP=1 \
-c "CREATE EXTENSION IF NOT EXISTS vector WITH SCHEMA public" \
-c "SHOW server_version" \
-c "SELECT extversion FROM pg_extension WHERE extname = 'vector'"
- name: Build and test
run: ./backend/gradlew -p backend build --no-daemon
# 별도 DB·Redis DB로 기본 회귀의 잔여 Job·캐시와 분리한다.
- name: Verify current authorization of saved answers and model inputs
env:
PERMISSION_VERIFY_JDBC_URL: jdbc:postgresql://127.0.0.1:55432/docgrid_current_auth
PERMISSION_VERIFY_USER: app
PERMISSION_VERIFY_PASSWORD: local_password
PERMISSION_VERIFY_REDIS_PORT: 6379
PERMISSION_VERIFY_REDIS_DB: 9
PERMISSION_VERIFY_JWT_SECRET: docgrid-ci-current-auth-only-not-for-production
PERMISSION_VERIFY_RUN_SUFFIX: CI-R1
run: |
docker exec ${{ job.services.postgres.id }} psql -U app -d app -v ON_ERROR_STOP=1 \
-c "CREATE DATABASE docgrid_current_auth OWNER app"
docker exec ${{ job.services.postgres.id }} psql -U app -d docgrid_current_auth -v ON_ERROR_STOP=1 \
-c "CREATE EXTENSION IF NOT EXISTS vector WITH SCHEMA public"
export PERMISSION_VERIFY_RUN_DIR="$GITHUB_WORKSPACE/backend/build/reports/permission-current-auth"
export PERMISSION_VERIFY_SOURCE_REVISION="$GITHUB_SHA"
./backend/gradlew -p backend permissionCurrentAuthorizationTest --no-daemon
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v7
with:
name: backend-test-reports-${{ github.run_id }}-${{ github.run_attempt }}
path: |
backend/build/test-results/test/
backend/build/reports/tests/test/
backend/build/test-results/permissionCurrentAuthorizationTest/
backend/build/reports/permission-current-auth/
if-no-files-found: warn
frontend:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: "22"
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm --prefix frontend ci
- name: Lint
run: npm --prefix frontend run lint
# test 스크립트가 production 빌드를 먼저 실행한다.
- name: Build and test
run: npm --prefix frontend test