Skip to content

Tests on Windows Conditional Compilation (VS 2022, Python 3.11) #405

Tests on Windows Conditional Compilation (VS 2022, Python 3.11)

Tests on Windows Conditional Compilation (VS 2022, Python 3.11) #405

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"
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@v4
with:
path: 'openvino'
submodules: 'true'
- name: Clone test models
uses: actions/checkout@v4
with:
repository: 'openvinotoolkit/testdata'
path: 'testdata'
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@v2
id: cpu-cores
- uses: ilammy/msvc-dev-cmd@v1
- name: Setup sccache
uses: hendrikmuhs/ccache-action@v1.2
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" `
-DCMAKE_VERBOSE_MAKEFILE=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