Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[CI] [GHA] Setup pip cache directory per Python on Windows; do not use cache for `setup-python` action (#28015)

Andrei Kashchikhin0e2edd87493e
diff --git a/.github/actions/setup_python/action.yml b/.github/actions/setup_python/action.yml
index 96968f55636..d1290508ab7 100644
--- a/.github/actions/setup_python/action.yml
+++ b/.github/actions/setup_python/action.yml
@@ -22,7 +22,6 @@ inputs:
runs:
using: 'composite'
steps:
-
- name: Check if Python is already installed (Linux)
if: ${{ runner.os == 'Linux' }}
shell: bash
@@ -54,13 +53,11 @@ runs:
with:
python-version: ${{ inputs.version }}
- - if: ${{ runner.os == 'macOS' || runner.os == 'Windows' || (runner.os == 'Linux' && runner.arch != 'ARM64' && steps.check_python.outputs.installed == 'false' ) }}
+ - if: ${{ runner.os == 'macOS' || runner.os == 'Windows' || (runner.os == 'Linux' && runner.arch != 'ARM64' && steps.check_python.outputs.installed == 'false') }}
name: Setup Python ${{ inputs.version }}
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ inputs.version }}
- env:
- PIP_CACHE_DIR: ${{ inputs.self-hosted-runner == 'true' && inputs.pip-cache-path || '' }}
- if: ${{ inputs.should-setup-pip-paths == 'true' && runner.os != 'Windows' }}
name: Setup pip variables (cache and install path)
diff --git a/.github/scripts/workflow_rerun/errors_to_look_for.json b/.github/scripts/workflow_rerun/errors_to_look_for.json
index ad771e9d51f..b9cac8f17ad 100644
--- a/.github/scripts/workflow_rerun/errors_to_look_for.json
+++ b/.github/scripts/workflow_rerun/errors_to_look_for.json
@@ -82,5 +82,9 @@
{
"error_text": "Upload progress stalled",
"ticket": 152933
+ },
+ {
+ "error_text": "because the GET request got Content-Type",
+ "ticket": 158400
}
]
\ No newline at end of file
diff --git a/.github/workflows/job_build_windows.yml b/.github/workflows/job_build_windows.yml
index 4e3969d978c..d5d42ffcfea 100644
--- a/.github/workflows/job_build_windows.yml
+++ b/.github/workflows/job_build_windows.yml
@@ -222,12 +222,20 @@ jobs:
$pythonCommand = "py -$pyVersion -c `"import sys; print(f'{sys.executable}')`""
$pythonExecutablePath = & cmd /c $pythonCommand
-
+
+ $pipVersion = & $pythonExecutablePath -c "import pip; print(pip.__version__)"
+ Write-Host "Using pip version: $pipVersion for $pyVersion"
+ $env:PIP_CACHE_DIR="${{ env.PIP_CACHE_PATH }}/$pipVersion"
+
& $pythonExecutablePath -m pip install -r ${{ env.OPENVINO_REPO }}/src/bindings/python/wheel/requirements-dev.txt
- cmake -DPython3_EXECUTABLE="$pythonExecutablePath" -DOpenVINODeveloperPackage_DIR=${{ env.BUILD_DIR }} -S ${{ env.OPENVINO_REPO }}/src/bindings/python -B "$pyBuildDir"
- cmake --build "$pyBuildDir" --parallel --config ${{ env.CMAKE_BUILD_TYPE }}
+ cmake -DPython3_EXECUTABLE="$pythonExecutablePath" -DOpenVINODeveloperPackage_DIR=${{ env.BUILD_DIR }} -S ${{ env.OPENVINO_REPO }}/src/bindings/python -B "$pyBuildDir" &&
+ cmake --build "$pyBuildDir" --parallel --config ${{ env.CMAKE_BUILD_TYPE }} &&
cmake --install "$pyBuildDir" --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_WHEELS_DIR }} --component python_wheels
+ if ($LASTEXITCODE -ne 0) {
+ Write-Host "Failed to build Python wheels for Python $pyVersion"
+ exit 1
+ }
}
- name: Pack Artifacts