mirror of
https://github.com/ZhuLinsen/daily_stock_analysis
synced 2026-09-20 10:53:33 +08:00
fix: stabilize backend ci dependency install (#835)
* fix: stabilize backend ci dependency install * fix: split backend gate workflow phases * fix: retry backend ci dependency install * fix: install litellm from github source
This commit is contained in:
@@ -2,20 +2,58 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "==> backend-gate: Python syntax check"
|
||||
python -m py_compile main.py src/config.py src/auth.py src/analyzer.py src/notification.py
|
||||
python -m py_compile src/storage.py src/scheduler.py src/search_service.py
|
||||
python -m py_compile src/market_analyzer.py src/stock_analyzer.py
|
||||
python -m py_compile data_provider/*.py
|
||||
syntax_check() {
|
||||
echo "==> backend-gate: Python syntax check"
|
||||
python -m py_compile main.py src/config.py src/auth.py src/analyzer.py src/notification.py
|
||||
python -m py_compile src/storage.py src/scheduler.py src/search_service.py
|
||||
python -m py_compile src/market_analyzer.py src/stock_analyzer.py
|
||||
python -m py_compile data_provider/*.py
|
||||
}
|
||||
|
||||
echo "==> backend-gate: flake8 critical checks"
|
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
flake8_checks() {
|
||||
echo "==> backend-gate: flake8 critical checks"
|
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
}
|
||||
|
||||
echo "==> backend-gate: local deterministic checks"
|
||||
./test.sh code
|
||||
./test.sh yfinance
|
||||
deterministic_checks() {
|
||||
echo "==> backend-gate: local deterministic checks"
|
||||
./test.sh code
|
||||
./test.sh yfinance
|
||||
}
|
||||
|
||||
echo "==> backend-gate: offline test suite"
|
||||
python -m pytest -m "not network"
|
||||
offline_test_suite() {
|
||||
echo "==> backend-gate: offline test suite"
|
||||
python -m pytest -m "not network"
|
||||
}
|
||||
|
||||
echo "==> backend-gate: all checks passed"
|
||||
run_all() {
|
||||
syntax_check
|
||||
flake8_checks
|
||||
deterministic_checks
|
||||
offline_test_suite
|
||||
echo "==> backend-gate: all checks passed"
|
||||
}
|
||||
|
||||
phase="${1:-all}"
|
||||
|
||||
case "$phase" in
|
||||
all)
|
||||
run_all
|
||||
;;
|
||||
syntax)
|
||||
syntax_check
|
||||
;;
|
||||
flake8)
|
||||
flake8_checks
|
||||
;;
|
||||
deterministic)
|
||||
deterministic_checks
|
||||
;;
|
||||
offline-tests)
|
||||
offline_test_suite
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 [all|syntax|flake8|deterministic|offline-tests]" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user