Skip to content

Commit

Permalink
[CI] [GHA] Setup pip cache directory per Python on Windows; do not us…
Browse files Browse the repository at this point in the history
…e cache for `setup-python` action (#28015)

### Tickets:
 - *155118*
 - *158400*
 - *158574*
 - *159198*
  • Loading branch information
akashchi authored Dec 19, 2024
1 parent a2b00ec commit 0e2edd8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
5 changes: 1 addition & 4 deletions .github/actions/setup_python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ inputs:
runs:
using: 'composite'
steps:

- name: Check if Python is already installed (Linux)
if: ${{ runner.os == 'Linux' }}
shell: bash
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions .github/scripts/workflow_rerun/errors_to_look_for.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,9 @@
{
"error_text": "Upload progress stalled",
"ticket": 152933
},
{
"error_text": "because the GET request got Content-Type",
"ticket": 158400
}
]
14 changes: 11 additions & 3 deletions .github/workflows/job_build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0e2edd8

Please sign in to comment.