diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index d8468bf..959709c 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -30,8 +30,11 @@ jobs: run: | CACHE_KEY="python-$(cat dashboard/backend/requirements.txt dashboard/backend/requirements-dev.txt | md5sum | cut -d' ' -f1)" CACHE_DIR="/tmp/pytest-cache/$CACHE_KEY" + PIP_CACHE_DIR="/tmp/pip-cache" echo "CACHE_DIR=$CACHE_DIR" >> $GITHUB_ENV echo "CACHE_KEY=$CACHE_KEY" >> $GITHUB_ENV + echo "PIP_CACHE_DIR=$PIP_CACHE_DIR" >> $GITHUB_ENV + mkdir -p "$PIP_CACHE_DIR" if [ -d "$CACHE_DIR" ]; then echo "Cache hit for $CACHE_KEY" echo "cache-hit=true" >> $GITHUB_OUTPUT @@ -45,17 +48,17 @@ jobs: run: | cd dashboard/backend if [ "${{ steps.cache-python.outputs.cache-hit }}" = "true" ]; then - echo "Restoring from cache $CACHE_KEY..." + echo "Restoring venv from cache $CACHE_KEY..." cp -a $CACHE_DIR/venv . else echo "Installing fresh dependencies..." python3 -m venv venv . venv/bin/activate - pip install --no-cache-dir -r requirements.txt - pip install --no-cache-dir -r requirements-dev.txt - pip install --no-cache-dir pytest-timeout + pip install --cache-dir=$PIP_CACHE_DIR -r requirements.txt + pip install --cache-dir=$PIP_CACHE_DIR -r requirements-dev.txt + pip install --cache-dir=$PIP_CACHE_DIR pytest-timeout # Save to cache - echo "Saving to cache $CACHE_KEY..." + echo "Saving venv to cache $CACHE_KEY..." cp -a venv $CACHE_DIR/ fi