Compare commits

...

7 Commits

Author SHA1 Message Date
xiaoxia 78247ac817 fix(ci): fix pip compatibility, add worker deps and PYTHONPATH
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 29s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 34s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 57s
CI/CD Pipeline / Unit Tests (push) Failing after 1m3s
CI/CD Pipeline / Integration Tests (push) Failing after 39s
CI/CD Pipeline / Integration Tests (pull_request) Failing after 39s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 1m57s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (push) Failing after 6m38s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (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 / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
- Remove --break-system-packages flag (pip 22 doesn't support it)
- Add requirements-worker.txt to install steps (numpy/scipy/opencv for worker tests)
- Add apps/worker to PYTHONPATH for worker module imports
- Use 'python3 -m pip' instead of bare 'pip' for consistency
2026-07-13 20:44:06 +08:00
xiaoxia 7fd9cb4261 fix(ci): remove --break-system-packages flag for pip 22 compatibility
pip 22.0.2 (Ubuntu 22.04 system default) does not support
--break-system-packages. This flag is not needed because:
- pip 22 has no externally-managed check
- source-compiled Python has no EXTERNALLY-MANAGED marker
2026-07-13 20:35:03 +08:00
xiaoxia 190bd35278 chore: trigger ci test 2026-07-13 20:32:39 +08:00
xiaoxia bc861eea69 chore: trigger ci 2026-07-13 20:31:17 +08:00
xiaoxia e0f291d911 fix(ci): use python3 -m pip instead of bare pip for compatibility
On CentOS with source-compiled Python 3.10, 'pip' command may not be
in PATH. Use 'python3 -m pip' which works everywhere.
2026-07-13 20:21:45 +08:00
xiaoxia 6d54468f8b fix(ci): add PIP_BREAK_SYSTEM_PACKAGES env var to all job envs 2026-07-13 20:20:37 +08:00
xiaoxia 73d249c1b6 fix(ci): use PIP_BREAK_SYSTEM_PACKAGES env var for pip 22 compatibility
pip 22.0.2 (Python 3.10 system default on Ubuntu 22.04) does not support
--break-system-packages flag. Use environment variable instead which is
supported by both old and new pip versions.
2026-07-13 20:19:49 +08:00
2 changed files with 18 additions and 14 deletions
+17 -14
View File
@@ -92,9 +92,10 @@ jobs:
shell: sh
run: |
set -eu
python3 -m pip install --break-system-packages -q -r requirements-base.txt
python3 -m pip install --break-system-packages -q -r requirements.txt
python3 -m pip install --break-system-packages -q -r requirements-dev.txt
python3 -m pip install -q -r requirements-base.txt
python3 -m pip install -q -r requirements.txt
python3 -m pip install -q -r requirements-dev.txt
python3 -m pip install -q -r requirements-worker.txt
python3 -m black --version
python3 -m isort --version-number
python3 -m flake8 --version
@@ -221,16 +222,17 @@ jobs:
shell: sh
run: |
set -eu
python3 -m pip install --break-system-packages -q -r requirements-base.txt
python3 -m pip install --break-system-packages -q -r requirements.txt
python3 -m pip install --break-system-packages -q -r requirements-dev.txt
python3 -m pip install -q -r requirements-base.txt
python3 -m pip install -q -r requirements.txt
python3 -m pip install -q -r requirements-dev.txt
python3 -m pip install -q -r requirements-worker.txt
pytest --version
- name: Run unit tests with coverage
shell: sh
run: |
set -eu
PYTHONPATH="$PWD/apps/api:$PWD" python3 -m coverage run \
PYTHONPATH="$PWD/apps/api:$PWD/apps/worker:$PWD" python3 -m coverage run \
--source=apps/api/app,packages \
--omit="*/migrations/*,*/tests/*,*/test_*.py,*/site-packages/*" \
--branch \
@@ -320,9 +322,10 @@ jobs:
shell: sh
run: |
set -eu
python3 -m pip install --break-system-packages -q -r requirements-base.txt
python3 -m pip install --break-system-packages -q -r requirements.txt
python3 -m pip install --break-system-packages -q -r requirements-dev.txt
python3 -m pip install -q -r requirements-base.txt
python3 -m pip install -q -r requirements.txt
python3 -m pip install -q -r requirements-dev.txt
python3 -m pip install -q -r requirements-worker.txt
pytest --version
- name: Start Redis
@@ -388,14 +391,14 @@ jobs:
shell: sh
run: |
set -eu
PYTHONPATH="$PWD/apps/api:$PWD" python3 -m alembic upgrade head
PYTHONPATH="$PWD/apps/api:$PWD/apps/worker:$PWD" python3 -m alembic upgrade head
- name: Run integration tests
shell: sh
run: |
set -eu
pip install --break-system-packages -q pytest-rerunfailures
PYTHONPATH="$PWD/apps/api:$PWD" python3 -m coverage run --append \
python3 -m pip install -q pytest-rerunfailures
PYTHONPATH="$PWD/apps/api:$PWD/apps/worker:$PWD" python3 -m coverage run --append \
--source=apps/api/app,packages \
--omit="*/migrations/*,*/tests/*,*/test_*.py,*/site-packages/*" \
--branch \
@@ -411,7 +414,7 @@ jobs:
set +e
echo "=== API 性能基线测试 ==="
PERF_OUTPUT=$(mktemp)
PYTHONPATH="$PWD/apps/api:$PWD" python3 -m pytest tests/integration/test_api_performance.py \
PYTHONPATH="$PWD/apps/api:$PWD/apps/worker:$PWD" python3 -m pytest tests/integration/test_api_performance.py \
-v --timeout=120 -p no:cacheprovider 2>&1 | tee "$PERF_OUTPUT"
PERF_EXIT=$?
+1
View File
@@ -0,0 +1 @@
trigger: 1783945959