v1.0-verified: 核心研究链路验证 + Alpha Discovery v1 #84
Workflow file for this run
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 | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| env: | |
| # Opt into Node.js 24 before the June 2, 2026 mandatory switch | |
| # (actions/checkout@v4, actions/setup-python@v5, actions/cache@v4 | |
| # all run on Node.js 20 which will be blocked after that date) | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Cache pip packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install -e . | |
| pip install ruff==0.15.12 mypy==1.14.1 | |
| - name: Make quant_platform importable | |
| run: echo "PYTHONPATH=$GITHUB_WORKSPACE/.." >> "$GITHUB_ENV" | |
| - name: Lint with ruff | |
| continue-on-error: true | |
| run: ruff check . --output-format=concise || true | |
| - name: Type check with mypy | |
| continue-on-error: true | |
| run: mypy quant_platform/ --config-file=pyproject.toml | |
| - name: Run tests | |
| run: pytest tests/ -v --tb=short | |
| build-frontend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install and build frontend | |
| working-directory: frontend | |
| run: | | |
| npm ci | |
| npm run build | |
| docker: | |
| runs-on: ubuntu-latest | |
| needs: [test, build-frontend] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Docker image | |
| run: docker build -t quant-platform:latest . | |
| - name: Verify container starts | |
| run: | | |
| docker run -d --name test-container -p 8000:8000 quant-platform:latest | |
| # Retry health check up to 12 times (2 min total) | |
| for i in $(seq 1 12); do | |
| sleep 10 | |
| if curl -sf http://localhost:8000/api/health > /dev/null 2>&1; then | |
| echo "Health check passed!" | |
| docker stop test-container | |
| exit 0 | |
| fi | |
| echo "Attempt $i/12 — not ready yet..." | |
| done | |
| echo "Container logs:" | |
| docker logs test-container 2>&1 || true | |
| docker stop test-container || true | |
| exit 1 |