refactoring #39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI Test (Pre-deployment) | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| name: Clean Architecture 테스트 | |
| runs-on: ubuntu-latest | |
| # Working Directory 중복 제거 | |
| defaults: | |
| run: | |
| working-directory: ./ai_server | |
| steps: | |
| - name: 코드 체크아웃 | |
| uses: actions/checkout@v3 | |
| - name: Python 설정 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Poetry 설치 | |
| run: | | |
| curl -sSL https://install.python-poetry.org | python3 - | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Poetry 캐시 | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cache/pypoetry | |
| ai_server/.venv | |
| key: ${{ runner.os }}-poetry-${{ hashFiles('ai_server/poetry.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-poetry- | |
| - name: 의존성 설치 (Poetry) | |
| run: | | |
| poetry install --no-interaction --no-ansi | |
| - name: Linting (ruff) - 코드 품질 검증 | |
| run: | | |
| poetry run ruff check app/ | |
| - name: 테스트 실행 (Clean Architecture) | |
| run: | | |
| poetry run pytest tests/refactoring/ -v --tb=short | |
| env: | |
| # Mock이므로 더미 키 사용 | |
| OPENAI_API_KEY: "test-key-dummy" | |
| LANGCHAIN_TRACING_V2: "false" | |
| LANGCHAIN_API_KEY: "test-key-dummy" | |
| LANGCHAIN_PROJECT: "test-project" | |
| CHROMA_PERSIST_DIRECTORY: "/tmp/chroma_test" | |
| CHROMA_COLLECTION_NAME: "qa_history" | |
| - name: 테스트 결과 요약 | |
| if: always() | |
| run: | | |
| if [ ${{ job.status }} == 'success' ]; then | |
| echo "✅ 모든 테스트 통과!" | |
| else | |
| echo "❌ 테스트 실패 - 배포 중단" | |
| exit 1 | |
| fi |