refactor: CI/CD 파이프라인 재설계 — SSOT + 계층화된 Quality Gates
Quant Engine CI/CD Pipeline / validate-core (push) Failing after 13s
Merge to Main (All Stages) / 1️⃣ Tier 1: Fast Gates (push) Failing after 6s
Quant Engine CI/CD Pipeline / validate-ui-and-storage (push) Has been skipped
Merge to Main (All Stages) / 2️⃣ Tier 2: Critical Gates (push) Has been skipped
Merge to Main (All Stages) / 3️⃣ Validators: Specs & Registry (push) Has been skipped
Merge to Main (All Stages) / 3️⃣ Validators: Coverage & WBS (push) Has been skipped
Merge to Main (All Stages) / 3️⃣ Validators: Reports & Ledger (push) Has been skipped
Merge to Main (All Stages) / 4️⃣ Build & Package (push) Has been skipped
Merge to Main (All Stages) / 5️⃣ Deploy to Production (push) Has been skipped
Merge to Main (All Stages) / Summary (push) Successful in 1s
Deploy to Production (Local) / Build & Deploy to Production (push) Failing after 1m26s
Build & Package / build (push) Failing after 1m30s
Quant Engine CI/CD Pipeline / validate-core (push) Failing after 13s
Merge to Main (All Stages) / 1️⃣ Tier 1: Fast Gates (push) Failing after 6s
Quant Engine CI/CD Pipeline / validate-ui-and-storage (push) Has been skipped
Merge to Main (All Stages) / 2️⃣ Tier 2: Critical Gates (push) Has been skipped
Merge to Main (All Stages) / 3️⃣ Validators: Specs & Registry (push) Has been skipped
Merge to Main (All Stages) / 3️⃣ Validators: Coverage & WBS (push) Has been skipped
Merge to Main (All Stages) / 3️⃣ Validators: Reports & Ledger (push) Has been skipped
Merge to Main (All Stages) / 4️⃣ Build & Package (push) Has been skipped
Merge to Main (All Stages) / 5️⃣ Deploy to Production (push) Has been skipped
Merge to Main (All Stages) / Summary (push) Successful in 1s
Deploy to Production (Local) / Build & Deploy to Production (push) Failing after 1m26s
Build & Package / build (push) Failing after 1m30s
**근본적 개선사항**: 1️⃣ **Single Source of Truth (SSOT)** - 빌드은 한 곳에서만 실행 (_common/build-and-test.yml) - 아티팩트 중앙화 (GitHub Actions artifacts) - build.yml과 deploy-prod.yml의 중복 빌드 제거 2️⃣ **계층화된 Quality Gates** - Tier 1: Fast Gates (<2min) - YAML lint, secret scan, JSON validation - Tier 2: Critical Gates (5min) - KIS API governance, DB schema - Tier 3: Integration Gates (15min, 병렬) - 30+ Python validators 3️⃣ **명확한 Workflow 책임** - fast-validation.yml: PR 검증 (2분 내 피드백) - merge-to-main.yml: 전체 파이프라인 (순차 + 의존성) - _common/build-and-test.yml: 공유 빌드 로직 4️⃣ **Observability 강화** - 각 stage별 명확한 성공/실패 표시 - Artifact 추적 가능 - 최종 summary report 생성 **기대 효과**: - 빌드 시간: 3-4분 → 1-2분 (-60%) - 실패율: 90% → <10% - 실패 원인 파악: 30분 → 5분 (-83%) - PR 피드백: 5분 → 2분 (-60%) **다음 작업**: - [ ] 기존 build.yml / deploy-prod.yml 정리 - [ ] Gitea secret 설정 (QUANTENGINE_DB_PASSWORD) - [ ] Validator 병렬화 최적화 - [ ] Notification 채널 구성 **참조**: - docs/CICD_ANALYSIS_AND_ROADMAP.md - 상세 분석 및 로드맵 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,108 @@
|
||||
name: Reusable Build & Test
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
outputs:
|
||||
artifact-path:
|
||||
description: "Built artifact path (quantengine-HASH.tar.gz)"
|
||||
value: ${{ jobs.build.outputs.artifact-path }}
|
||||
build-tag:
|
||||
description: "Build tag for release/deployment"
|
||||
value: ${{ jobs.build.outputs.build-tag }}
|
||||
commit-hash:
|
||||
description: "Git commit hash (short)"
|
||||
value: ${{ jobs.build.outputs.commit-hash }}
|
||||
|
||||
env:
|
||||
DOTNET_VERSION: '10.0.x'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
|
||||
outputs:
|
||||
artifact-path: quantengine-${{ steps.metadata.outputs.commit }}.tar.gz
|
||||
build-tag: build-${{ steps.metadata.outputs.commit }}-${{ github.run_number }}
|
||||
commit-hash: ${{ steps.metadata.outputs.commit }}
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
||||
|
||||
- name: Generate Build Metadata
|
||||
id: metadata
|
||||
run: |
|
||||
COMMIT=$(git rev-parse --short HEAD)
|
||||
BUILD_TIME=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||
|
||||
echo "commit=${COMMIT}" >> $GITHUB_OUTPUT
|
||||
echo "build-time=${BUILD_TIME}" >> $GITHUB_OUTPUT
|
||||
echo "✓ Metadata: ${COMMIT} @ ${BUILD_TIME}"
|
||||
|
||||
- name: Restore Dependencies
|
||||
run: dotnet restore src/dotnet/QuantEngine.Web/QuantEngine.Web.csproj
|
||||
|
||||
- name: Build Release
|
||||
run: |
|
||||
dotnet build src/dotnet/QuantEngine.Web/QuantEngine.Web.csproj \
|
||||
-c Release \
|
||||
--no-restore
|
||||
|
||||
- name: Run Unit Tests
|
||||
run: |
|
||||
dotnet test src/dotnet/QuantEngine.Core.Tests/QuantEngine.Core.Tests.csproj \
|
||||
-c Release \
|
||||
--no-build
|
||||
|
||||
- name: Publish Release Package
|
||||
run: |
|
||||
dotnet publish src/dotnet/QuantEngine.Web/QuantEngine.Web.csproj \
|
||||
-c Release \
|
||||
--no-build \
|
||||
-o ./publish
|
||||
|
||||
- name: Create Version Metadata
|
||||
run: |
|
||||
mkdir -p ./publish/wwwroot
|
||||
cat > ./publish/wwwroot/version.json <<EOF
|
||||
{
|
||||
"version": "1.0.${{ github.run_number }}-${{ steps.metadata.outputs.commit }}",
|
||||
"commit": "${{ steps.metadata.outputs.commit }}",
|
||||
"built": "${{ steps.metadata.outputs.build-time }}",
|
||||
"buildNumber": ${{ github.run_number }}
|
||||
}
|
||||
EOF
|
||||
|
||||
- name: Package Artifact
|
||||
run: |
|
||||
tar -czf quantengine-${{ steps.metadata.outputs.commit }}.tar.gz \
|
||||
-C ./publish .
|
||||
|
||||
SIZE=$(du -sh quantengine-${{ steps.metadata.outputs.commit }}.tar.gz | cut -f1)
|
||||
echo "📦 Package: quantengine-${{ steps.metadata.outputs.commit }}.tar.gz ($SIZE)"
|
||||
|
||||
# Verify integrity
|
||||
tar -tzf quantengine-${{ steps.metadata.outputs.commit }}.tar.gz > /dev/null || exit 1
|
||||
echo "✓ Package integrity verified"
|
||||
|
||||
- name: Upload Build Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: quantengine-build-${{ github.run_number }}
|
||||
path: quantengine-${{ steps.metadata.outputs.commit }}.tar.gz
|
||||
retention-days: 5
|
||||
|
||||
- name: Report Build Success
|
||||
if: success()
|
||||
run: |
|
||||
echo "✅ Build successful"
|
||||
echo " Tag: build-${{ steps.metadata.outputs.commit }}-${{ github.run_number }}"
|
||||
echo " Artifact: quantengine-${{ steps.metadata.outputs.commit }}.tar.gz"
|
||||
Reference in New Issue
Block a user