OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[CI] [GHA] Set pip cache directory correctly on Windows (#27456)
Andrei Kashchikhin05e12d05e0a0
diff --git a/.github/actions/setup_python/action.yml b/.github/actions/setup_python/action.ymlindex 80e22866170..96968f55636 100644--- a/.github/actions/setup_python/action.yml+++ b/.github/actions/setup_python/action.yml@@ -62,7 +62,7 @@ runs:env:PIP_CACHE_DIR: ${{ inputs.self-hosted-runner == 'true' && inputs.pip-cache-path || '' }}- - if: ${{ inputs.should-setup-pip-paths == 'true' }}+ - if: ${{ inputs.should-setup-pip-paths == 'true' && runner.os != 'Windows' }}name: Setup pip variables (cache and install path)shell: bashrun: |@@ -71,6 +71,14 @@ runs:echo "PIP_CACHE_DIR=${{ inputs.pip-cache-path }}/${PIP_VER}" >> $GITHUB_ENVecho "PIP_INSTALL_PATH=$(python3 -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')" >> $GITHUB_ENV+ - if: ${{ inputs.should-setup-pip-paths == 'true' && runner.os == 'Windows' }}+ name: Setup pip cache path+ shell: pwsh+ run: |+ $pipVersion = python3 -c "import pip; print(pip.__version__)"+ Write-Host "Using pip version: $pipVersion"+ "PIP_CACHE_DIR=${{ inputs.pip-cache-path }}/$pipVersion" >> $env:GITHUB_ENV+- if: ${{ inputs.show-cache-info == 'true' }}name: Get pip cache infoshell: bashdiff --git a/.github/workflows/job_build_windows.yml b/.github/workflows/job_build_windows.ymlindex 4ea82590e7a..8a39f348d82 100644--- a/.github/workflows/job_build_windows.yml+++ b/.github/workflows/job_build_windows.yml@@ -25,7 +25,7 @@ on:permissions: read-allenv:- PIP_CACHE_PATH: /mount/caches/pip/win+ PIP_CACHE_PATH: "C:\\mount\\caches\\pip\\win"PYTHON_VERSION: '3.11'jobs:diff --git a/.github/workflows/job_pytorch_layer_tests.yml b/.github/workflows/job_pytorch_layer_tests.ymlindex 4ea6d33336f..b0eba0a278e 100644--- a/.github/workflows/job_pytorch_layer_tests.yml+++ b/.github/workflows/job_pytorch_layer_tests.yml@@ -24,7 +24,8 @@ on:permissions: read-allenv:- PIP_CACHE_PATH: /mount/caches/pip/linux+ PIP_CACHE_PATH_LINUX: /mount/caches/pip/linux+ PIP_CACHE_PATH_WIN: "C:\\mount\\caches\\pip\\win"jobs:PyTorch_Layer_Tests:@@ -94,9 +95,9 @@ jobs:uses: ./openvino/.github/actions/setup_pythonwith:version: ${{ inputs.python-version }}- pip-cache-path: ${{ runner.os == 'Linux' && env.PIP_CACHE_PATH || '' }}- should-setup-pip-paths: ${{ runner.os == 'Linux' }}- self-hosted-runner: ${{ runner.os == 'Linux' }}+ pip-cache-path: ${{ runner.os == 'Linux' && env.PIP_CACHE_PATH_LINUX || env.PIP_CACHE_PATH_WIN }}+ should-setup-pip-paths: ${{ runner.os != 'macOS' }}+ self-hosted-runner: ${{ runner.os != 'macOS' }}- name: Install OpenVINO Python wheels (Linux and macOS)if: runner.os != 'Windows'diff --git a/.github/workflows/job_tensorflow_layer_tests.yml b/.github/workflows/job_tensorflow_layer_tests.ymlindex 26730f9b55d..29afb466d69 100644--- a/.github/workflows/job_tensorflow_layer_tests.yml+++ b/.github/workflows/job_tensorflow_layer_tests.yml@@ -24,7 +24,8 @@ on:permissions: read-allenv:- PIP_CACHE_PATH: /mount/caches/pip/linux+ PIP_CACHE_PATH_LINUX: /mount/caches/pip/linux+ PIP_CACHE_PATH_WIN: "C:\\mount\\caches\\pip\\win"jobs:TensorFlow_Layer_Tests:@@ -94,9 +95,9 @@ jobs:uses: ./openvino/.github/actions/setup_pythonwith:version: ${{ inputs.python-version }}- pip-cache-path: ${{ runner.os == 'Linux' && env.PIP_CACHE_PATH || '' }}- should-setup-pip-paths: ${{ runner.os == 'Linux' }}- self-hosted-runner: ${{ runner.os == 'Linux' }}+ pip-cache-path: ${{ runner.os == 'Linux' && env.PIP_CACHE_PATH_LINUX || env.PIP_CACHE_PATH_WIN }}+ should-setup-pip-paths: ${{ runner.os != 'macOS' }}+ self-hosted-runner: ${{ runner.os != 'macOS' }}- name: Install OpenVINO Python wheels (Linux and macOS)if: runner.os != 'Windows'diff --git a/.github/workflows/job_tokenizers.yml b/.github/workflows/job_tokenizers.ymlindex 5c5e59aa3be..4b84bee25c7 100644--- a/.github/workflows/job_tokenizers.yml+++ b/.github/workflows/job_tokenizers.yml@@ -28,7 +28,8 @@ on:permissions: read-allenv:- PIP_CACHE_PATH: /mount/caches/pip/linux+ PIP_CACHE_PATH_LINUX: /mount/caches/pip/linux+ PIP_CACHE_PATH_WIN: "C:\\mount\\caches\\pip\\win"TARGET_BRANCH: ${{ github.base_ref || github.event.merge_group.base_ref || github.ref }}jobs:@@ -70,9 +71,9 @@ jobs:uses: ./.github/actions/setup_pythonwith:version: ${{ inputs.python-version }}- pip-cache-path: ${{ runner.os == 'Linux' && env.PIP_CACHE_PATH || '' }}- should-setup-pip-paths: ${{ runner.os == 'Linux' }}- self-hosted-runner: ${{ runner.os == 'Linux' }}+ pip-cache-path: ${{ runner.os == 'Linux' && env.PIP_CACHE_PATH_LINUX || env.PIP_CACHE_PATH_WIN }}+ should-setup-pip-paths: ${{ runner.os != 'macOS' }}+ self-hosted-runner: ${{ runner.os != 'macOS' }}- name: Clone OpenVINO Tokenizersuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2diff --git a/.github/workflows/windows_vs2019_release.yml b/.github/workflows/windows_vs2019_release.ymlindex b9b8fa76d37..a416f577cdb 100644--- a/.github/workflows/windows_vs2019_release.yml+++ b/.github/workflows/windows_vs2019_release.yml@@ -14,7 +14,7 @@ concurrency:env:TARGET_BRANCH: ${{ github.base_ref || github.event.merge_group.base_ref || github.ref }}- PIP_CACHE_PATH: /mount/caches/pip/win+ PIP_CACHE_PATH: "C:\\mount\\caches\\pip\\win"PYTHON_VERSION: '3.11'permissions: read-all@@ -287,7 +287,7 @@ jobs:with:version: ${{ env.PYTHON_VERSION }}pip-cache-path: ${{ env.PIP_CACHE_PATH }}- should-setup-pip-paths: 'false'+ should-setup-pip-paths: 'true'self-hosted-runner: 'true'- name: Install OpenVINO Python wheels