forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
170 lines (149 loc) · 5.94 KB
/
windows_conditional_compilation.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
name: Tests on Windows Conditional Compilation (VS 2022, Python 3.11)
on:
workflow_dispatch:
schedule:
# run daily at 00:00
- cron: '0 0 * * *'
# pull_request:
# paths-ignore:
# - '**/docs/**'
# - 'docs/**'
# - '**/**.md'
# - '**.md'
# - '**/layer_tests_summary/**'
# - '**/conformance/**'
# push:
# paths-ignore:
# - '**/docs/**'
# - 'docs/**'
# - '**/**.md'
# - '**.md'
# - '**/layer_tests_summary/**'
# - '**/conformance/**'
# branches:
# - master
concurrency:
group: ${{ github.head_ref || github.run_id }}-windows-cc
cancel-in-progress: true
env:
CMAKE_BUILD_TYPE: 'Release'
CMAKE_GENERATOR: 'Ninja'
CMAKE_CXX_COMPILER_LAUNCHER: sccache
CMAKE_C_COMPILER_LAUNCHER: sccache
OPENVINO_REPO: "${{ github.workspace }}\\openvino"
OPENVINO_CONTRIB_REPO: "${{ github.workspace }}\\openvino_contrib"
INSTALL_DIR: "${{ github.workspace }}\\install_pkg"
INSTALL_TEST_DIR: "${{ github.workspace }}\\install\\tests"
SAMPLES_INSTALL_DIR: "${{ github.workspace }}\\install\\samples"
LAYER_TESTS_INSTALL_DIR: "${{ github.workspace }}\\install\\tests\\layer_tests"
BUILD_DIR: "${{ github.workspace }}\\build"
BUILD_DIR_2: "${{ github.workspace }}\\build_s"
DATA_PATH: "${{ github.workspace }}\\testdata"
MODELS_PATH: "${{ github.workspace }}\\testdata"
OV_TEMP: "${{ github.workspace }}\\openvino_temp"
BUILD_TYPE: "Release"
PYTHON_STATIC_ARGS: -m "not dynamic_library and not template_plugin"
VCVARSPATH: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat"
jobs:
Build:
# TODO: remove. Temporary measure to prevent the workflow from scheduling on forks.
if: ${{ github.repository_owner == 'openvinotoolkit' }}
defaults:
run:
shell: pwsh
runs-on: windows-latest-8-cores
steps:
- name: Clone OpenVINO
uses: actions/checkout@v3
with:
path: 'openvino'
submodules: 'recursive'
- name: Clone testdata for sample test
uses: actions/checkout@v4
with:
repository: 'openvinotoolkit/testdata'
path: 'testdata'
submodules: 'recursive'
lfs: 'true'
#
# Dependencies
#
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install build dependencies
run: |
choco install --no-progress ninja
#
# Build
#
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- uses: ilammy/msvc-dev-cmd@v1
- name: Setup sccache
uses: hendrikmuhs/[email protected]
with:
variant: sccache
max-size: "2000M"
# 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: ${{ github.ref_name == 'master' && 'true' || 'false' }}
key: ${{ github.job }}-windows-cc
restore-keys: |
${{ github.job }}-windows-cc
- name: CMake CC COLLECT
run: |
& "${{ env.VCVARSPATH }}" x64 && cmake -G Ninja `
-DENABLE_CPPLINT=OFF `
-DENABLE_GAPI_PREPROCESSING=OFF `
-DENABLE_PLUGINS_XML=ON `
-DCMAKE_COMPILE_WARNING_AS_ERROR=OFF `
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} `
-DENABLE_PROFILING_ITT=ON `
-DSELECTIVE_BUILD=COLLECT `
-S ${{ env.OPENVINO_REPO }} `
-B ${{ env.BUILD_DIR }}
- name: Build CC COLLECT
run: |
& "${{ env.VCVARSPATH }}" x64 && cmake --build ${{ env.BUILD_DIR }} --parallel ${{ steps.cpu-cores.outputs.count }} --config ${{ env.BUILD_TYPE }} `
--target openvino_intel_cpu_plugin openvino_ir_frontend benchmark_app sea_itt_lib
- name: List bin files
shell: cmd
run: dir ${{ env.OPENVINO_REPO }}\bin\ /s
- name: Code usage analysis
shell: cmd
working-directory: ${{ env.OPENVINO_REPO }}
run: |
set path=%path%;${{ env.OPENVINO_REPO }}\temp\tbb\bin
call "${{ env.VCVARSPATH }}" && python thirdparty\itt_collector\runtool\sea_runtool.py --bindir ${{ env.OPENVINO_REPO }}\bin\intel64\${{ env.BUILD_TYPE }} -o ${{ env.BUILD_DIR }}\itt_stat ! ${{ env.OPENVINO_REPO }}\bin\intel64\${{ env.BUILD_TYPE }}\benchmark_app.exe -niter 1 -nireq 1 -m ${{ env.MODELS_PATH }}\models\test_model\test_model_fp32.xml -d CPU
- name: List csv files
shell: cmd
run: dir ${{ env.BUILD_DIR }}\*.csv /s /p
- name: CMake CC ON
run: |
& "${{ env.VCVARSPATH }}" x64 && cmake -G "Visual Studio 17 2022" `
-DVERBOSE_BUILD=ON `
-DENABLE_CPPLINT=OFF `
-DENABLE_GAPI_PREPROCESSING=OFF `
-DENABLE_PROFILING_ITT=OFF `
-DSELECTIVE_BUILD=ON `
-DCMAKE_COMPILE_WARNING_AS_ERROR=OFF `
-DSELECTIVE_BUILD_STAT=${{ env.BUILD_DIR }}\*.csv `
-S ${{ env.OPENVINO_REPO }} `
-B ${{ env.BUILD_DIR_2 }}
- name: Build CC ON
run: |
& "${{ env.VCVARSPATH }}" x64 && cmake --build ${{ env.BUILD_DIR_2 }} --parallel ${{ steps.cpu-cores.outputs.count }} --config ${{ env.BUILD_TYPE }} `
--target openvino_intel_cpu_plugin openvino_ir_frontend benchmark_app
- name: List bin files ON
shell: cmd
run: dir ${{ env.OPENVINO_REPO }}\bin\ /s
- name: Check conditional_compilation_gen.h header
shell: cmd
run: type ${{ env.BUILD_DIR_2 }}\src\common\conditional_compilation\conditional_compilation_gen.h
- name: Use OpenVINO after CC
shell: cmd
run: |
set path=%path%;${{ env.OPENVINO_REPO }}\temp\tbb\bin
${{ env.OPENVINO_REPO }}\bin\intel64\${{ env.BUILD_TYPE }}\benchmark_app.exe -niter 1 -nireq 1 -m ${{ env.MODELS_PATH }}\models\test_model\test_model_fp32.xml -d CPU