chore: cache uv .venv in cicd
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user