File tree Expand file tree Collapse file tree 1 file changed +30
-5
lines changed Expand file tree Collapse file tree 1 file changed +30
-5
lines changed Original file line number Diff line number Diff line change @@ -95,16 +95,41 @@ 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'
101+
102+ - name : Install uv (pip alternative)
103+ id : setup_uv
104+ # Docs: https://github.com/astral-sh/uv?tab=readme-ov-file#getting-started
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"
117+ shell : bash
118+
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'
102127
103128 - name : Install backend dependencies
104129 run : |
105- pip install -r requirements/ci.txt \
106- --use-pep517 \
107- --use-feature=no-binary-enable-wheel-cache
130+ uv pip install \
131+ --system \
132+ -r requirements/ci.txt
108133 shell : bash
109134 working-directory : ${{ inputs.working-directory }}
110135
You can’t perform that action at this time.
0 commit comments