name: "Cache uv downloads" description: >- Restore the uv download cache on every run and save it only from main, so pull requests reuse main's cache instead of evicting it with their own copies. runs: using: composite steps: - name: Restore and save the uv download cache if: github.ref == 'refs/heads/main' uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: ${{ env.UV_CACHE_DIR }} key: ${{ runner.os }}-uv-downloads-py${{ env.UV_PYTHON }}-${{ hashFiles('uv.lock') }} restore-keys: | ${{ runner.os }}-uv-downloads-py${{ env.UV_PYTHON }}- - name: Restore the uv download cache if: github.ref != 'refs/heads/main' uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: ${{ env.UV_CACHE_DIR }} key: ${{ runner.os }}-uv-downloads-py${{ env.UV_PYTHON }}-${{ hashFiles('uv.lock') }} restore-keys: | ${{ runner.os }}-uv-downloads-py${{ env.UV_PYTHON }}-