28 lines
987 B
YAML
28 lines
987 B
YAML
name: Setup uv cache
|
|
description: Composite action to determine uv cache dir and restore cache.
|
|
author: Daniel Fichtinger
|
|
outputs:
|
|
cache-hit:
|
|
description: "Whether the uv cache was restored"
|
|
value: ${{ steps.cache-output.outputs.cache-hit }}
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Get uv cache directory
|
|
id: uv-cache
|
|
shell: bash
|
|
run: |
|
|
echo "dir=$(uv cache dir)" >> "$GITHUB_OUTPUT"
|
|
- name: Restore uv cache
|
|
id: cache-restore
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ steps.uv-cache.outputs.dir }}
|
|
key: ${{ runner.os }}-uv-${{ hashFiles('**/*requirements*.txt', '**/*requirements*.in', '**/*constraints*.txt', '**/*constraints*.in', '**/pyproject.toml', '**/uv.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-uv-
|
|
- name: Capture cache-hit output
|
|
id: cache-output
|
|
shell: bash
|
|
run: |
|
|
echo "cache-hit=${{ steps.cache-restore.outputs.cache-hit }}" >> "$GITHUB_OUTPUT"
|