Skip to content

Commit 7be7327

Browse files
authored
[CI] [GHA] Transfer Mac workflow from Azure to GHA (#912)
* transfer linux workflow * provide ref * install git-lfs * install unzip * correct path for log * upload test results * use gha runner * rm sudo * skip test * rm unused env vars from linux; add win workflow * configure msvc * add build of ov_contrib * use setupvars * use quotes * use ov repo * use cmd * call cmd setupvars * add nvidia job * add generator * do not use dev package * add missing ref * allow downgrades * allow change * add dev package * enable system * use from fork * rm system * use hash * update hash * enable tests * build dev targets, do not build tests * enable tests * use master * add mac * install gradle via brew * upload test results * use actions/cache * unskip * new line
1 parent 9dcfd50 commit 7be7327

File tree

1 file changed

+149
-0
lines changed

1 file changed

+149
-0
lines changed

.github/workflows/mac.yml

+149
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
name: macOS (Python 3.11)
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
- 'releases/**'
9+
10+
concurrency:
11+
# github.ref is not unique in post-commit
12+
group: ${{ github.event_name == 'push' && github.run_id || github.ref }}-mac-main
13+
cancel-in-progress: true
14+
15+
env:
16+
PYTHON_VERSION: '3.11'
17+
18+
jobs:
19+
Build_and_test:
20+
name: Build and Test
21+
timeout-minutes: 150
22+
defaults:
23+
run:
24+
shell: bash
25+
runs-on: 'macos-13-large'
26+
env:
27+
CMAKE_BUILD_TYPE: 'Release'
28+
MACOSX_DEPLOYMENT_TARGET: '11.0'
29+
OSX_ARCHITECTURES: 'x86_64'
30+
CMAKE_CXX_COMPILER_LAUNCHER: ccache
31+
CMAKE_C_COMPILER_LAUNCHER: ccache
32+
OPENVINO_REPO: ${{ github.workspace }}/openvino
33+
OPENVINO_CONTRIB_REPO: ${{ github.workspace }}/openvino_contrib
34+
TEST_DATA: ${{ github.workspace }}/testdata
35+
INSTALL_DIR: ${{ github.workspace }}/openvino_install
36+
INSTALL_DIR_JS: ${{ github.workspace }}/openvino_install/js
37+
INSTALL_TEST_DIR: ${{ github.workspace }}/tests_install
38+
BUILD_DIR: ${{ github.workspace }}/build
39+
CCACHE_DIR: ${{ github.workspace }}/ccache
40+
CCACHE_MAXSIZE: '2G'
41+
GRADLE_VER: '7.1.1'
42+
steps:
43+
- name: Clone OpenVINO
44+
uses: actions/checkout@v4
45+
with:
46+
repository: 'openvinotoolkit/openvino'
47+
path: 'openvino'
48+
submodules: 'true'
49+
ref: 'master'
50+
51+
- name: Clone OpenVINO Contrib
52+
uses: actions/checkout@v4
53+
with:
54+
path: 'openvino_contrib'
55+
56+
- name: Clone Testdata
57+
uses: actions/checkout@v4
58+
with:
59+
repository: 'openvinotoolkit/testdata'
60+
path: 'testdata'
61+
lfs: 'true'
62+
submodules: 'true'
63+
64+
#
65+
# Dependencies
66+
#
67+
68+
- name: Install build dependencies
69+
run: brew install coreutils ninja scons automake gradle ccache
70+
71+
- name: Setup Python ${{ env.PYTHON_VERSION }}
72+
uses: actions/setup-python@v5
73+
with:
74+
python-version: ${{ env.PYTHON_VERSION }}
75+
76+
- name: Install python dependencies
77+
run: python3 -m pip install -r ${{ env.OPENVINO_REPO }}/src/bindings/python/wheel/requirements-dev.txt
78+
79+
#
80+
# Build
81+
#
82+
83+
- name: Setup ccache
84+
uses: actions/cache@v4
85+
with:
86+
# Should save cache only if run in the master branch of the base repo
87+
# github.ref_name is 'ref/PR_#' in case of the PR, and 'branch_name' when executed on push
88+
save-always: ${{ github.ref_name == 'master' && 'true' || 'false' }}
89+
path: ${{ env.CCACHE_DIR }}
90+
key: ${{ runner.os }}-${{ runner.arch }}-ccache-${{ github.sha }}
91+
restore-keys: |
92+
${{ runner.os }}-${{ runner.arch }}-ccache
93+
94+
- name: CMake configure
95+
run: |
96+
cmake \
97+
-GNinja \
98+
-DCMAKE_VERBOSE_MAKEFILE=ON \
99+
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} \
100+
-DBUILD_nvidia_plugin=OFF \
101+
-DOPENVINO_EXTRA_MODULES=${{ env.OPENVINO_CONTRIB_REPO }}/modules \
102+
-DCMAKE_OSX_DEPLOYMENT_TARGET=${{ env.MACOSX_DEPLOYMENT_TARGET }} \
103+
-DCMAKE_OSX_ARCHITECTURES=${{ env.OSX_ARCHITECTURES }} \
104+
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CMAKE_CXX_COMPILER_LAUNCHER }} \
105+
-DCMAKE_C_COMPILER_LAUNCHER=${{ env.CMAKE_C_COMPILER_LAUNCHER }} \
106+
-DENABLE_OV_PADDLE_FRONTEND=OFF \
107+
-DENABLE_OV_TF_FRONTEND=OFF \
108+
-DENABLE_OV_TF_LITE_FRONTEND=OFF \
109+
-DENABLE_OV_PYTORCH_FRONTEND=OFF \
110+
-DENABLE_CPPLINT=OFF \
111+
-DENABLE_INTEL_NPU=OFF \
112+
-S ${{ env.OPENVINO_REPO }} \
113+
-B ${{ env.BUILD_DIR }}
114+
115+
- name: Cmake build
116+
run: cmake --build ${{ env.BUILD_DIR }} --parallel
117+
118+
- name: Show ccache stats
119+
run: ccache --show-stats
120+
121+
- name: Cmake install
122+
run: cmake -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -P ${{ env.BUILD_DIR }}/cmake_install.cmake
123+
124+
- name: Java tests
125+
working-directory: ${{ env.OPENVINO_CONTRIB_REPO }}/modules/java_api
126+
run: |
127+
. ${{ env.INSTALL_DIR }}/setupvars.sh gradle clean build --info
128+
129+
for d in CPU HETERO:CPU; do
130+
gradle test -Prun_tests -DMODELS_PATH=${{ env.TEST_DATA }} -Ddevice=$d --info;
131+
done
132+
133+
- name: Check wheel installation
134+
run: |
135+
source ${{ env.INSTALL_DIR }}/setupvars.sh
136+
python3 -m pip install -r ${{ env.OPENVINO_CONTRIB_REPO }}/modules/custom_operations/tests/requirements.txt
137+
138+
pushd ${{ env.INSTALL_DIR }}/tools
139+
wheel_name=$(find . -name 'openvino-*.whl')
140+
python3 -m pip install $wheel_name
141+
popd
142+
143+
- name: Upload Test Results
144+
uses: actions/upload-artifact@v4
145+
if: ${{ !cancelled() }}
146+
with:
147+
name: test-results-java
148+
path: ${{ env.OPENVINO_CONTRIB_REPO }}/modules/java_api/build/test-results
149+
if-no-files-found: 'warn'

0 commit comments

Comments
 (0)