File tree Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -95,16 +95,36 @@ runs:
9595 shell : bash
9696
9797 - uses : actions/setup-python@v5
98+ id : setup_python
9899 with :
99100 python-version : ${{ inputs.python-version }}
100- cache : ' pip'
101- cache-dependency-path : ' ${{ steps.requirements_path.outputs.requirements_dir_prefix }}requirements/*.txt'
102101
103102 - name : Install uv (pip alternative)
103+ id : setup_uv
104104 # Docs: https://github.com/astral-sh/uv?tab=readme-ov-file#getting-started
105- run : pip install uv
105+ run : |
106+ pip install uv
107+ # calculate cache parameters
108+
109+ cache_dependency_path="${{ steps.requirements_path.outputs.requirements_dir_prefix }}requirements/*.txt"
110+
111+ ubuntu_version=$(lsb_release -rs)
112+ restore_key="uv-${{ runner.os }}-Ubuntu-${ubuntu_version}-python-${{ steps.setup_python.outputs.python-version }}"
113+
114+ echo "uv_cache_dir=$(uv cache dir)" >> "$GITHUB_OUTPUT"
115+ echo "cache_dependency_path=${cache_dependency_path}" >> "$GITHUB_OUTPUT"
116+ echo "cache_restore_key=${restore_key}" >> "$GITHUB_OUTPUT"
106117 shell : bash
107118
119+ - name : (Restore) uv cache
120+ uses : actions/cache@v4
121+ with :
122+ path : ${{ steps.setup_uv.outputs.uv_cache_dir }}
123+ key : ${{ steps.setup_uv.outputs.cache_restore_key }}-${{ hashFiles(steps.setup_uv.outputs.cache_dependency_path) }}
124+ restore-keys : |
125+ ${{ steps.setup_uv.outputs.cache_restore_key }}-
126+ save-always : ' true'
127+
108128 - name : Install backend dependencies
109129 run : |
110130 uv pip install \
You can’t perform that action at this time.
0 commit comments