Skip to content

Commit 8db08c1

Browse files
authored
[GHA] Store mac artifacts per commit (#29086)
### Details: - Store mac artifacts per commit on internal share ### Tickets: - *ticket-id*
1 parent 00dbc94 commit 8db08c1

File tree

2 files changed

+110
-11
lines changed

2 files changed

+110
-11
lines changed

.github/actions/common/constants.py

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class EventType(Enum):
1919
'public_windows_vs2022_release',
2020
'public_windows_vs2022_debug',
2121
'public_manylinux2014_x86_64_release',
22+
'public_macos_x86_64_release',
2223
)
2324
ProductType = Enum('ProductType', {t.upper(): t for t in productTypes})
2425

@@ -44,4 +45,5 @@ class EventType(Enum):
4445
PlatformKey.UBUNTU22_X86_64: ProductType.PUBLIC_LINUX_UBUNTU_22_04_X86_64_RELEASE,
4546
PlatformKey.UBUNTU24_X86_64: ProductType.PUBLIC_LINUX_UBUNTU_24_04_X86_64_RELEASE,
4647
PlatformKey.WINDOWS_X86_64: ProductType.PUBLIC_WINDOWS_VS2022_RELEASE,
48+
PlatformKey.MACOS_12_6_X86_64: ProductType.PUBLIC_MACOS_X86_64_RELEASE,
4749
}

.github/workflows/mac.yml

+108-11
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,16 @@ permissions: read-all
3333

3434
env:
3535
PYTHON_VERSION: '3.11'
36+
MANIFEST_FILE: manifest.yml
37+
PRODUCT_TYPE: public_macos_x86_64_release
3638

3739
jobs:
40+
3841
Smart_CI:
3942
runs-on: ubuntu-latest
4043
outputs:
4144
affected_components: "${{ steps.smart_ci.outputs.affected_components }}"
45+
changed_components: "${{ steps.smart_ci.outputs.changed_components }}"
4246
skip_workflow: "${{ steps.smart_ci.outputs.skip_workflow }}"
4347
steps:
4448
- name: checkout action
@@ -59,7 +63,7 @@ jobs:
5963
repo_token: ${{ secrets.GITHUB_TOKEN }}
6064
skip_when_only_listed_labels_set: 'docs'
6165
skip_when_only_listed_files_changed: '*.md,*.rst,*.png,*.jpg,*.svg'
62-
66+
6367
Build:
6468
needs: Smart_CI
6569
timeout-minutes: 150
@@ -78,6 +82,7 @@ jobs:
7882
INSTALL_DIR: ${{ github.workspace }}/openvino_install
7983
INSTALL_DIR_JS: ${{ github.workspace }}/openvino_install/js
8084
INSTALL_TEST_DIR: ${{ github.workspace }}/tests_install
85+
DEVELOPER_PACKAGE_DIR: ${{ github.workspace }}/developer_package_install
8186
INSTALL_WHEELS_DIR: ${{ github.workspace }}/install/wheels
8287
BUILD_DIR: ${{ github.workspace }}/build
8388
if: "!needs.smart_ci.outputs.skip_workflow"
@@ -171,17 +176,22 @@ jobs:
171176

172177
- name: Cmake install - OpenVINO
173178
run: |
174-
cmake -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -P ${{ env.BUILD_DIR }}/cmake_install.cmake
175-
cmake -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_TEST_DIR }} -DCOMPONENT=tests -P ${{ env.BUILD_DIR }}/cmake_install.cmake
179+
cmake --install . --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_DIR }}
180+
cmake --install . --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_TEST_DIR }} --component tests
181+
cmake --install . --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.DEVELOPER_PACKAGE_DIR }} --component developer_package
182+
working-directory: ${{ env.BUILD_DIR }}
176183

177-
- name: Pack Artifacts
178-
run: |
179-
pushd ${{ env.INSTALL_DIR }}
180-
tar -cvf - * | pigz > ${{ env.BUILD_DIR }}/openvino_package.tar.gz
181-
popd
182-
pushd ${{ env.INSTALL_TEST_DIR }}
183-
tar -cvf - * | pigz > ${{ env.BUILD_DIR }}/openvino_tests.tar.gz
184-
popd
184+
- name: Pack openvino_package
185+
run: tar -cvf - * | pigz > ${{ env.BUILD_DIR }}/openvino_package.tar.gz
186+
working-directory: ${{ env.INSTALL_DIR }}
187+
188+
- name: Pack openvino_developer_package
189+
run: tar -cvf - * | pigz > ${{ env.BUILD_DIR }}/openvino_developer_package.tar.gz
190+
working-directory: ${{ env.DEVELOPER_PACKAGE_DIR }}
191+
192+
- name: Pack openvino_tests
193+
run: tar -cvf - * | pigz > ${{ env.BUILD_DIR }}/openvino_tests.tar.gz
194+
working-directory: ${{ env.INSTALL_TEST_DIR }}
185195

186196
# Setup additional Python versions for wheels building
187197
- name: Setup Python 3.9
@@ -225,6 +235,18 @@ jobs:
225235
should-setup-pip-paths: 'false'
226236
self-hosted-runner: 'false'
227237

238+
- name: Generate product manifest and set CI_BUILD_NUMBER & CI_BUILD_DEV_TAG
239+
id: create_manifest
240+
uses: ./openvino/.github/actions/create_manifest
241+
with:
242+
repos: |
243+
${{ env.OPENVINO_REPO }}
244+
${{ env.OPENVINO_CONTRIB_REPO }}
245+
product_type: ${{ env.PRODUCT_TYPE }}
246+
target_arch: ${{ runner.arch }}
247+
build_type: 'release'
248+
save_to: ${{ github.workspace }}/${{ env.MANIFEST_FILE }}
249+
228250
- name: Cmake & Build - OpenVINO Contrib
229251
run: |
230252
cmake \
@@ -275,13 +297,30 @@ jobs:
275297
name: openvino_tests
276298
path: ${{ env.BUILD_DIR }}/openvino_tests.tar.gz
277299
if-no-files-found: 'error'
300+
301+
- name: Upload openvino developer package
302+
if: ${{ always() }}
303+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
304+
with:
305+
name: openvino_developer_package
306+
path: ${{ env.BUILD_DIR }}/openvino_developer_package.tar.gz
307+
if-no-files-found: 'error'
308+
278309
- name: Upload openvino js package
279310
if: fromJSON(needs.smart_ci.outputs.affected_components).JS_API
280311
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
281312
with:
282313
name: openvino_js_package
283314
path: ${{ env.BUILD_DIR }}/openvino_js_package.tar.gz
284315
if-no-files-found: 'error'
316+
317+
- name: Upload product manifest
318+
if: ${{ always() }}
319+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
320+
with:
321+
name: openvino_package_manifest
322+
path: ${{ github.workspace }}/${{ env.MANIFEST_FILE }}
323+
if-no-files-found: 'error'
285324

286325
Samples:
287326
needs: [ Build, Smart_CI ]
@@ -377,3 +416,61 @@ jobs:
377416
with:
378417
runner: 'macos-13'
379418
python-version: '3.11'
419+
420+
upload_artifacts:
421+
name: Upload OpenVINO artifacts
422+
timeout-minutes: 10
423+
needs: [Build, Smart_CI]
424+
defaults:
425+
run:
426+
shell: bash
427+
runs-on: aks-linux-2-cores-8gb
428+
container:
429+
image: 'openvinogithubactions.azurecr.io/library/python:3.12-slim'
430+
volumes:
431+
- /mount:/mount
432+
- ${{ github.workspace }}:${{ github.workspace }}
433+
env:
434+
OPENVINO_REPO: ${{ github.workspace }}/openvino
435+
OPENVINO_CONTRIB_REPO: ${{ github.workspace }}/openvino_contrib
436+
ARTIFACTS_DIR: ${{ github.workspace }}/artifacts
437+
WHEELS_DIR: ${{ github.workspace }}/wheels
438+
ARTIFACTS_SHARE: "/mount/build-artifacts"
439+
440+
steps:
441+
- name: Checkout OpenVINO actions
442+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
443+
timeout-minutes: 15
444+
with:
445+
sparse-checkout: |
446+
.github/actions/common
447+
.github/actions/store_artifacts
448+
path: ${{ env.OPENVINO_REPO }}
449+
450+
- name: Download OpenVINO artifacts
451+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
452+
with:
453+
pattern: "{openvino_package,openvino_developer_package,openvino_js_package,openvino_package_manifest}"
454+
path: ${{ env.ARTIFACTS_DIR }}
455+
merge-multiple: true
456+
457+
- name: Download OpenVINO wheels
458+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
459+
with:
460+
name: openvino_wheels
461+
path: ${{ env.WHEELS_DIR }}
462+
merge-multiple: true
463+
464+
- name: Store artifacts to a shared drive
465+
id: store_artifacts
466+
if: ${{ always() }}
467+
uses: ./openvino/.github/actions/store_artifacts
468+
with:
469+
artifacts: |
470+
${{ env.ARTIFACTS_DIR }}/${{ env.MANIFEST_FILE }}
471+
${{ env.ARTIFACTS_DIR }}/openvino_package.tar.gz
472+
${{ env.ARTIFACTS_DIR }}/openvino_developer_package.tar.gz
473+
${{ env.WHEELS_DIR }}
474+
${{ fromJSON(needs.smart_ci.outputs.affected_components).JS_API && format('{0}/openvino_js_package.tar.gz', env.ARTIFACTS_DIR) || '' }}
475+
storage_dir: ${{ env.PRODUCT_TYPE }}
476+
storage_root: ${{ env.ARTIFACTS_SHARE }}

0 commit comments

Comments
 (0)