0a8bfc9bcc
CI/CD Pipeline / Check if frontend-only change (push) Has been skipped
CI/CD Pipeline / Build Production API Image (push) Has been skipped
CI/CD Pipeline / Build Production Web Image (push) Has been skipped
CI/CD Pipeline / Build Production Worker Image (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Build Staging API Image (push) Failing after 24s
CI/CD Pipeline / Build Staging Web Image (push) Failing after 29s
CI/CD Pipeline / Build Staging Worker Image (push) Failing after 29s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (push) Has been skipped
CI/CD Pipeline / Staging E2E Tests (push) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (push) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 3m23s
CI/CD Pipeline / Validate Code Quality And Tests (push) Successful in 3m24s
CI/CD Pipeline / Frontend Lint (push) Successful in 3m49s
CI/CD Pipeline / Unit Tests (push) Successful in 4m7s
CI/CD Pipeline / Integration Tests (push) Successful in 1m32s
Co-authored-by: xiaoxia <dev@xiaoxiajianji.com> Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
49 lines
1.3 KiB
Bash
Executable File
49 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# mypy增é‡�扫æ��脚本 - CIä¸è°ƒç”¨
|
|
# 环境��: SCAN_MODE, CHANGED_PY_FILES
|
|
|
|
set -e
|
|
|
|
echo "=== Installing mypy ==="
|
|
python3 -m pip install -q mypy
|
|
mypy --version
|
|
echo ""
|
|
echo "=== Running mypy type check (hard gate mode) ==="
|
|
echo "å‘Šè¦æ¨¡å¼�,ä¸Í阻æ–CI"
|
|
echo ""
|
|
|
|
MYPY_COMMON_ARGS="--ignore-missing-imports --no-site-packages --no-strict-optional --explicit-package-bases --exclude tests/|test_|migrations/|alembic/ --no-error-summary --incremental --cache-dir .mypy_cache"
|
|
|
|
EXIT_CODE=0
|
|
|
|
if [ "$SCAN_MODE" = "incremental" ] && [ -n "$CHANGED_PY_FILES" ]; then
|
|
echo "=== Incremental mypy scan (PR mode) ==="
|
|
echo "Changed files: $(echo $CHANGED_PY_FILES | wc -w) files"
|
|
MYPY_FILES=""
|
|
for f in $CHANGED_PY_FILES; do
|
|
case "$f" in
|
|
apps/*|packages/*)
|
|
MYPY_FILES="$MYPY_FILES $f"
|
|
;;
|
|
esac
|
|
done
|
|
if [ -n "$MYPY_FILES" ]; then
|
|
echo "Checking: $MYPY_FILES"
|
|
mypy $MYPY_FILES $MYPY_COMMON_ARGS 2>&1 | head -80 || EXIT_CODE=$?
|
|
else
|
|
echo "No mypy-checkable files changed, skipping"
|
|
fi
|
|
else
|
|
echo "=== Full mypy scan ==="
|
|
mypy apps/api/app packages $MYPY_COMMON_ARGS 2>&1 | head -60 || EXIT_CODE=$?
|
|
fi
|
|
|
|
echo ""
|
|
if [ "$EXIT_CODE" != "0" ]; then
|
|
echo "mypy å�‘çŽ°ç±»åž‹é—®é¢˜ï¼ˆå‘Šè¦æ¨¡å¼�,ä¸Í阻æ–)"
|
|
echo "建议å�Žç»é€�æ¥ä¿®å¤�"
|
|
else
|
|
echo "mypy 类型检查通过"
|
|
fi
|
|
|