-
Notifications
You must be signed in to change notification settings - Fork 144
208 lines (179 loc) · 7.84 KB
/
windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: Windows (VS 2019, Python 3.11)
on:
workflow_dispatch:
pull_request:
merge_group:
push:
branches:
- master
- 'releases/**'
concurrency:
# github.ref is not unique in post-commit
group: ${{ github.event_name == 'push' && github.run_id || github.ref }}-windows
cancel-in-progress: true
env:
PYTHON_VERSION: '3.11'
permissions: read-all
jobs:
Build_and_test:
name: Build and Test
timeout-minutes: 150
defaults:
run:
shell: pwsh
runs-on: windows-2019-16-core
env:
CMAKE_BUILD_TYPE: 'Release'
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CMAKE_C_COMPILER_LAUNCHER: ccache
OPENVINO_REPO: ${{ github.workspace }}\\openvino
OPENVINO_CONTRIB_REPO: ${{ github.workspace }}\\openvino_contrib
TEST_DATA: ${{ github.workspace }}\\testdata
INSTALL_DIR: ${{ github.workspace }}\\openvino\\install
BUILD_DIR: ${{ github.workspace }}\\openvino\\build
BUILD_DIR_CONTRIB: ${{ github.workspace }}\\openvino\\build_contrib
CCACHE_DIR: ${{ github.workspace }}\\ccache
CCACHE_MAXSIZE: "2G"
GRADLE_VER: '7.1.1'
steps:
- name: git configuration
run: git config --system core.longpaths true
- name: Clone OpenVINO
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
repository: 'openvinotoolkit/openvino'
path: ${{ env.OPENVINO_REPO }}
submodules: 'true'
ref: 'master'
- name: Clone OpenVINO Contrib
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
path: ${{ env.OPENVINO_CONTRIB_REPO }}
submodules: 'true'
- name: Clone Testdata
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
repository: 'openvinotoolkit/testdata'
path: ${{ env.TEST_DATA }}
lfs: 'true'
submodules: 'true'
#
# Dependencies
#
- name: Setup Gradle
uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
with:
gradle-version: ${{ env.GRADLE_VER }}
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
- name: Install python dependencies
run: |
# For Python API: build and wheel packaging
python3 -m pip install -r ${env:OPENVINO_REPO}/src/bindings/python/wheel/requirements-dev.txt
- name: Install build dependencies
run: |
Invoke-WebRequest https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip -OutFile ninja-win.zip -MaximumRetryCount 10
Expand-Archive -Force ninja-win.zip
# Add it to the GitHub Path so it would be available in the subsequent steps
Add-Content -Path $env:GITHUB_PATH -Value "${{ github.workspace }}/ninja-win"
choco install opencv -y
#
# Build
#
- name: Configure Developer Command Prompt for Microsoft Visual C++
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
- name: Download and install ccache
run: |
Invoke-WebRequest -Uri 'https://github.com/ccache/ccache/releases/download/v4.9.1/ccache-4.9.1-windows-x86_64.zip' -OutFile 'ccache.zip'
Expand-Archive -Path 'ccache.zip' -DestinationPath 'C:\temp\ccache'
Move-Item -Path 'C:\temp\ccache\*' -Destination 'C:\ccache'
Add-Content -Path $env:GITHUB_PATH -Value "C:\ccache"
- name: Setup ccache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
# Should save cache only if run in the master branch of the base repo
# github.ref_name is 'ref/PR_#' in case of the PR, and 'branch_name' when executed on push
save-always: ${{ github.ref_name == 'master' && 'true' || 'false' }}
path: ${{ env.CCACHE_DIR }}
key: ${{ runner.os }}-${{ runner.arch }}-ccache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-ccache
- name: CMake configure - OpenVINO
run: |
$env:OpenCV_DIR="C:/tools/opencv/build"
& "C:\tools\opencv\build\setup_vars_opencv4.cmd"
cmake -GNinja `
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} `
-DBUILD_nvidia_plugin=OFF `
-DENABLE_OV_TF_FRONTEND=OFF `
-DENABLE_OV_PADDLE_FRONTEND=OFF `
-DENABLE_OV_TF_LITE_FRONTEND=OFF `
-DENABLE_OV_PYTORCH_FRONTEND=OFF `
-DENABLE_INTEL_GPU=OFF `
-DENABLE_CPPLINT=OFF `
-DENABLE_SAMPLES=OFF `
-DENABLE_PYTHON=ON `
-DENABLE_INTEL_NPU=OFF `
-DENABLE_JS=OFF `
-DOPENVINO_EXTRA_MODULES=${{ env.OPENVINO_CONTRIB_REPO }}/modules `
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CMAKE_CXX_COMPILER_LAUNCHER }} `
-DCMAKE_C_COMPILER_LAUNCHER=${{ env.CMAKE_C_COMPILER_LAUNCHER }} `
-S ${{ env.OPENVINO_REPO }} `
-B ${{ env.BUILD_DIR }}
- name: Clean ccache stats
run: ccache --zero-stats --show-config
- name: Cmake build - OpenVINO
run: cmake --build ${{ env.BUILD_DIR }} --parallel --config ${{ env.CMAKE_BUILD_TYPE }} --verbose
- name: Show ccache stats
run: ccache --show-stats
- name: Cmake install - OpenVINO
run: cmake -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -P ${{ env.BUILD_DIR }}/cmake_install.cmake
- name: CMake configure - OpenVINO Contrib
run: |
$env:OpenCV_DIR="C:/tools/opencv/build"
. "${{ env.INSTALL_DIR }}/setupvars.ps1"
cmake -GNinja `
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} `
-S ${{ env.OPENVINO_CONTRIB_REPO }}/modules/custom_operations `
-B ${{ env.BUILD_DIR_CONTRIB }}
- name: Cmake build - OpenVINO Contrib
run: cmake --build ${{ env.BUILD_DIR_CONTRIB }} --parallel --config ${{ env.CMAKE_BUILD_TYPE }} --verbose
- name: Java tests
working-directory: ${{ env.OPENVINO_CONTRIB_REPO }}/modules/java_api
run: |
. "${{ env.INSTALL_DIR }}/setupvars.ps1"
gradle clean build --info
gradle test -Prun_tests -DMODELS_PATH=${{ env.TEST_DATA }} -Ddevice=CPU --info
- name: Custom user operation tests
working-directory: ${{ env.OPENVINO_CONTRIB_REPO }}/modules/custom_operations
shell: cmd
run: |
call C:\tools\opencv\build\setup_vars_opencv4.cmd
call ${{ env.INSTALL_DIR }}\setupvars.bat
python3 -m pip install -r ${{ env.OPENVINO_CONTRIB_REPO }}\modules\custom_operations\tests\requirements.txt
python3 -m pytest -k "not sparse_conv" tests\run_tests.py
env:
CUSTOM_OP_LIB: ${{ env.OPENVINO_REPO }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}/user_ov_extensions.dll
- name: Upload Test Results
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: ${{ !cancelled() }}
with:
name: test-results-java
path: ${{ env.OPENVINO_CONTRIB_REPO }}/modules/java_api/build/test-results
if-no-files-found: 'warn'
Overall_Status:
name: ci/gha_overall_status_windows
needs: [ Build_and_test ]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Check status of all jobs
if: >-
${{
contains(needs.*.result, 'failure') ||
contains(needs.*.result, 'cancelled')
}}
run: exit 1