name: Fast Validation (Tier 1 - < 2min) on: pull_request: branches: [ main ] workflow_dispatch: # 목적: PR 검증 시 빠른 피드백 (2분 이내) # - Lint & Format # - Security check (hardcoded secrets) # - Spec validation (YAML/JSON) # # 실패 시: PR 피드백 (배포 차단 안 함) jobs: quick-gates: runs-on: ubuntu-latest timeout-minutes: 2 steps: - name: Checkout Code uses: actions/checkout@v3 - name: YAML Lint run: | echo "🔍 Checking YAML files..." python3 -m pip install -q yamllint pyyaml yamllint -c "{extends: default, rules: {line-length: {max: 120}}}" \ .gitea/workflows/*.yml || echo "⚠️ YAML lint warnings (non-critical)" - name: Security: No Hardcoded Secrets run: | echo "🔐 Scanning for hardcoded secrets..." # Check for common password patterns grep -r "Password=" .gitea/workflows/ --include="*.yml" | \ grep -v "secrets\." && exit 1 || echo "✓ No hardcoded passwords found" # Check for API keys grep -r "api_key=" . --include="*.yml" --include="*.json" | \ grep -v "secrets\." && exit 1 || echo "✓ No hardcoded API keys" echo "✅ Security check passed" - name: JSON Validation run: | echo "✓ Checking JSON files..." python3 -c " import json, glob for f in glob.glob('**/*.json', recursive=True): try: with open(f) as file: json.load(file) print(f' ✓ {f}') except Exception as e: print(f' ❌ {f}: {e}') exit(1) " || exit 1 - name: Spec Files Validation run: | echo "🔍 Validating spec files..." # Check for required spec files test -f spec/strategy_execution_lock_policy.yaml && echo "✓ strategy_execution_lock_policy.yaml" || echo "⚠️ Missing strategy file" # Validate YAML structure python3 -c " import yaml try: with open('spec/strategy_execution_lock_policy.yaml') as f: yaml.safe_load(f) print('✓ YAML structure valid') except Exception as e: print(f'❌ YAML error: {e}') exit(1) " - name: .NET Project Structure run: | echo "🔍 Checking .NET project files..." # Verify key csproj files exist test -f "src/dotnet/QuantEngine.Web/QuantEngine.Web.csproj" && \ echo "✓ QuantEngine.Web.csproj" || exit 1 # Quick XML validation python3 -c " from xml.etree import ElementTree as ET try: ET.parse('src/dotnet/QuantEngine.Web/QuantEngine.Web.csproj') print('✓ Project file structure valid') except Exception as e: print(f'❌ XML error: {e}') exit(1) " - name: Report Results if: always() run: | echo "" echo "==============================================" echo "✅ Fast Validation Complete (Tier 1)" echo "==============================================" echo "" echo "Checks passed:" echo " ✓ YAML lint" echo " ✓ No hardcoded secrets" echo " ✓ JSON validation" echo " ✓ Spec files" echo " ✓ .NET projects"