From 6672999757ebd74a75b97ffa11f79b0c29c8cf37 Mon Sep 17 00:00:00 2001 From: "Gan, Jimmy" Date: Thu, 4 Jun 2026 20:20:30 +0800 Subject: [PATCH] fix(ci): validate venv cache by testing pytest, use python -m pytest --- .gitea/workflows/deploy-dev.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deploy-dev.yml b/.gitea/workflows/deploy-dev.yml index dfbbc80..a81cf70 100644 --- a/.gitea/workflows/deploy-dev.yml +++ b/.gitea/workflows/deploy-dev.yml @@ -54,7 +54,7 @@ jobs: cd dashboard/backend if [ "${{ steps.cache-python.outputs.cache-hit }}" = "true" ]; then echo "Restoring venv from cache $CACHE_KEY..." - if cp -a $CACHE_DIR/venv . && [ -f venv/bin/activate ]; then + if cp -a $CACHE_DIR/venv . && [ -f venv/bin/activate ] && venv/bin/python -m pytest --version >/dev/null 2>&1; then echo "Cache restored successfully" else echo "Cache corrupted, installing fresh..." @@ -88,7 +88,7 @@ jobs: run: | cd dashboard/backend . venv/bin/activate - pytest tests/ -v --timeout=60 + python -m pytest tests/ -v --timeout=60 if [ $? -ne 0 ]; then echo "❌ Backend tests failed!" exit 1