Skip to content

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

[CI] [GHA] Fix `CCACHE_REMOTE_DIR` value if in merge group (#26268)

Andrei Kashchikhin20afc5014d46
diff --git a/.github/workflows/job_build_windows.yml b/.github/workflows/job_build_windows.yml
index 0c0d05b4a39..4dabda29336 100644
--- a/.github/workflows/job_build_windows.yml
+++ b/.github/workflows/job_build_windows.yml
@@ -32,7 +32,7 @@ jobs:
CMAKE_GENERATOR: 'Ninja Multi-Config'
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CMAKE_C_COMPILER_LAUNCHER: ccache
- CCACHE_REMOTE_DIR: "C:\\mount\\caches\\ccache\\windows2022_x86_64_${{ inputs.build-type }}\\${{ github.base_ref || github.event.merge_group.base_ref || github.ref_name }}"
+ CCACHE_REMOTE_DIR: ""
CCACHE_DIR: ${{ github.workspace }}\\ccache
CCACHE_MAXSIZE: 3G
OPENVINO_REPO: "${{ github.workspace }}\\openvino"
@@ -58,6 +58,21 @@ jobs:
path: 'openvino_contrib'
ref: 'master'
+ - name: Set CCACHE_REMOTE_DIR based on event
+ shell: bash
+ run: |
+ final_dir=""
+ if [[ "${{ github.event_name }}" == "merge_group" ]]; then
+ branch_ref="${{ github.event.merge_group.base_ref }}" # Resolves into "refs/heads/master"
+ final_dir="${branch_ref##*/}" # Resolves into "master"
+ elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
+ final_dir="${{ github.base_ref }}" # Resolves into "master"
+ else
+ final_dir="${{ github.ref_name }}" # Resolves into "master"
+ fi
+
+ echo "CCACHE_REMOTE_DIR=C:\\\mount\\\caches\\\ccache\\\windows2022_x86_64_${{ inputs.build-type }}\\\\${final_dir}" >> $GITHUB_ENV
+
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: ./openvino/.github/actions/setup_python
with: