Validate cached venv before use (test python binary works)
Deploy Dashboard (Main) / Frontend Tests (push) Has been cancelled
Deploy Dashboard (Main) / Deploy to Production (push) Has been cancelled
Deploy Dashboard (Main) / Backend Tests (push) Has been cancelled

Cached venvs from NAS Docker containers have broken symlinks when
restored on the VPS host, causing "pytest: command not found".
Add a functional check that venv/bin/python runs before accepting
the cache as valid.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Gan, Jimmy
2026-06-03 11:42:24 +08:00
parent c8b87561a8
commit 951d68f022
+1 -1
View File
@@ -55,7 +55,7 @@ jobs:
cd dashboard/backend cd dashboard/backend
if [ "${{ steps.cache-python.outputs.cache-hit }}" = "true" ]; then if [ "${{ steps.cache-python.outputs.cache-hit }}" = "true" ]; then
echo "Restoring venv from cache $CACHE_KEY..." 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 -c "import sys; sys.exit(0)"; then
echo "Cache restored successfully" echo "Cache restored successfully"
else else
echo "Cache corrupted, installing fresh..." echo "Cache corrupted, installing fresh..."