fix(ci): validate venv cache by testing pytest, use python -m pytest
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user