From 2d60a28294de2d20bd4c3bea71da57b979c9bb25 Mon Sep 17 00:00:00 2001 From: Benjamin Labrecque Date: Fri, 10 Jul 2026 11:05:59 +0200 Subject: [PATCH] chore: cache uv .venv in cicd --- .gitea/workflows/add-new-service.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/add-new-service.yml b/.gitea/workflows/add-new-service.yml index 6a0e886..21df4ee 100644 --- a/.gitea/workflows/add-new-service.yml +++ b/.gitea/workflows/add-new-service.yml @@ -31,9 +31,21 @@ jobs: SERVICE_NAME="${BRANCH#feature/add-service-}" echo "service_name_lower=$SERVICE_NAME" >> $GITHUB_OUTPUT - - name: Initialize Virtual Environment from cli/pyproject.toml + - name: Cache Python Virtual Environment + uses: actions/cache@v4 + with: + path: .venv + # Changes uv.lock will automatically invalidate the cache and rebuild + key: ${{ runner.os }}-uv-venv-${{ hashFiles('cli/uv.lock') }} + restore-keys: | + ${{ runner.os }}-uv-venv- + + - name: Initialize Virtual Environment from cli/uv.lock run: | - uv venv .venv + # Only create the venv if the cache didn't restore an existing one + if [ ! -d ".venv" ]; then + uv venv .venv + fi uv sync --directory cli - name: Install Ansible Galaxy Collections