fix(ci): validate venv cache by testing pytest, use python -m pytest
Deploy Dashboard (Dev) / Backend Tests (push) Failing after 17s
Deploy Dashboard (Dev) / Build Dev Image (push) Has been skipped
Deploy Dashboard (Dev) / Deploy to Dev (push) Has been cancelled
Deploy Dashboard (Dev) / Frontend Tests (push) Has been cancelled

This commit is contained in:
Gan, Jimmy
2026-06-04 20:20:30 +08:00
parent 12a015e915
commit 6672999757
+2 -2
View File
@@ -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