Skip to content

Commit e5a5c05

Browse files
authored
[CI] [GHA] Transfer Linux and Windows workflows from Azure to GitHub Actions (#904)
* 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 * rm unused * use actions/cache for ccache * unskip
1 parent e2dd6b9 commit e5a5c05

File tree

2 files changed

+368
-0
lines changed

2 files changed

+368
-0
lines changed

.github/workflows/linux.yml

+177
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
name: Linux (Ubuntu 20.04, Python 3.11)
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
paths-ignore:
6+
- 'modules/nvidia_plugin'
7+
- 'modules/openvino_code'
8+
push:
9+
branches:
10+
- master
11+
- 'releases/**'
12+
paths-ignore:
13+
- 'modules/nvidia_plugin'
14+
- 'modules/openvino_code'
15+
16+
concurrency:
17+
# github.ref is not unique in post-commit
18+
group: ${{ github.event_name == 'push' && github.run_id || github.ref }}-linux
19+
cancel-in-progress: true
20+
21+
env:
22+
PYTHON_VERSION: '3.11'
23+
24+
jobs:
25+
Build_and_test:
26+
name: Build and Test
27+
timeout-minutes: 150
28+
defaults:
29+
run:
30+
shell: bash
31+
runs-on: ubuntu-20.04-16-cores
32+
container:
33+
image: ubuntu:20.04
34+
env:
35+
DEBIAN_FRONTEND: noninteractive # to prevent apt-get from waiting user input
36+
CMAKE_BUILD_TYPE: 'Release'
37+
CMAKE_CXX_COMPILER_LAUNCHER: ccache
38+
CMAKE_C_COMPILER_LAUNCHER: ccache
39+
GITHUB_WORKSPACE: /__w/openvino_contrib/openvino_contrib
40+
OPENVINO_REPO: /__w/openvino_contrib/openvino_contrib/openvino
41+
OPENVINO_CONTRIB_REPO: /__w/openvino_contrib/openvino_contrib/openvino_contrib
42+
TEST_DATA: /__w/openvino_contrib/openvino_contrib/testdata
43+
INSTALL_DIR: /__w/openvino_contrib/openvino_contrib/openvino_install
44+
BUILD_DIR: /__w/openvino_contrib/openvino_contrib/openvino_build
45+
CCACHE_DIR: /__w/openvino_contrib/openvino_contrib/ccache
46+
CCACHE_MAXSIZE: "2G"
47+
GRADLE_VER: '7.1.1'
48+
49+
steps:
50+
- name: Set apt retries
51+
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries
52+
53+
- name: Install git
54+
run: |
55+
apt-get update
56+
apt-get install --assume-yes --no-install-recommends git git-lfs ca-certificates
57+
58+
- name: Clone OpenVINO
59+
uses: actions/checkout@v4
60+
with:
61+
repository: 'openvinotoolkit/openvino'
62+
path: ${{ env.OPENVINO_REPO }}
63+
submodules: 'true'
64+
ref: 'master'
65+
66+
- name: Clone OpenVINO Contrib
67+
uses: actions/checkout@v4
68+
with:
69+
path: ${{ env.OPENVINO_CONTRIB_REPO }}
70+
submodules: 'true'
71+
72+
- name: Clone Testdata
73+
uses: actions/checkout@v4
74+
with:
75+
repository: 'openvinotoolkit/testdata'
76+
path: ${{ env.TEST_DATA }}
77+
lfs: 'true'
78+
submodules: 'true'
79+
80+
#
81+
# Dependencies
82+
#
83+
84+
- name: Install build dependencies
85+
run: |
86+
bash ${OPENVINO_REPO}/install_build_dependencies.sh
87+
# default-jdk - Java API; unzip for gradle installation
88+
apt install --assume-yes --no-install-recommends default-jdk libopencv-dev unzip
89+
90+
- name: Setup Gradle
91+
uses: gradle/actions/setup-gradle@v3
92+
with:
93+
gradle-version: ${{ env.GRADLE_VER }}
94+
95+
- name: Setup Python ${{ env.PYTHON_VERSION }}
96+
uses: actions/setup-python@v5
97+
with:
98+
python-version: ${{ env.PYTHON_VERSION }}
99+
100+
- name: Install python dependencies
101+
run: python3 -m pip install -r ${OPENVINO_REPO}/src/bindings/python/wheel/requirements-dev.txt
102+
103+
- name: Setup ccache
104+
uses: actions/cache@v4
105+
with:
106+
# Should save cache only if run in the master branch of the base repo
107+
# github.ref_name is 'ref/PR_#' in case of the PR, and 'branch_name' when executed on push
108+
save-always: ${{ github.ref_name == 'master' && 'true' || 'false' }}
109+
path: ${{ env.CCACHE_DIR }}
110+
key: ${{ runner.os }}-${{ runner.arch }}-ccache-${{ github.sha }}
111+
restore-keys: |
112+
${{ runner.os }}-${{ runner.arch }}-ccache
113+
114+
#
115+
# Build
116+
#
117+
118+
- name: CMake configure - OpenVINO
119+
run: |
120+
cmake \
121+
-GNinja \
122+
-DCMAKE_VERBOSE_MAKEFILE=ON \
123+
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} \
124+
-DBUILD_nvidia_plugin=OFF \
125+
-DENABLE_INTEL_GPU=OFF \
126+
-DENABLE_OV_TF_FRONTEND=OFF \
127+
-DENABLE_OV_PADDLE_FRONTEND=OFF \
128+
-DENABLE_OV_TF_LITE_FRONTEND=OFF \
129+
-DENABLE_OV_PYTORCH_FRONTEND=OFF \
130+
-DOPENVINO_EXTRA_MODULES=${OPENVINO_CONTRIB_REPO}/modules \
131+
-DENABLE_PYTHON=ON \
132+
-DENABLE_WHEEL=ON \
133+
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CMAKE_CXX_COMPILER_LAUNCHER }} \
134+
-DCMAKE_C_COMPILER_LAUNCHER=${{ env.CMAKE_C_COMPILER_LAUNCHER }} \
135+
-S ${OPENVINO_REPO} \
136+
-B ${BUILD_DIR}
137+
138+
- name: Clean ccache stats
139+
run: ccache --zero-stats --show-config
140+
141+
- name: Cmake build
142+
run: cmake --build ${BUILD_DIR} --parallel
143+
144+
- name: Show ccache stats
145+
run: ccache --show-stats
146+
147+
- name: Cmake install
148+
run: cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -P ${BUILD_DIR}/cmake_install.cmake
149+
150+
- name: Java tests
151+
working-directory: ${{ env.OPENVINO_CONTRIB_REPO }}/modules/java_api
152+
run: |
153+
source ${INSTALL_DIR}/setupvars.sh
154+
gradle clean build --info
155+
156+
for d in CPU HETERO:CPU; do
157+
gradle test -Prun_tests -DMODELS_PATH=${TEST_DATA} -Ddevice=$d --info;
158+
done
159+
160+
- name: Install requirements for custom operations tests
161+
run: |
162+
python3 -m pip install -r ${OPENVINO_CONTRIB_REPO}/modules/custom_operations/tests/requirements.txt
163+
python3 -m pip install ${INSTALL_DIR}/tools/openvino-*.whl
164+
165+
- name: Custom user operation tests
166+
working-directory: ${{ env.OPENVINO_CONTRIB_REPO }}/modules/custom_operations
167+
run: python3 -m pytest -k "not sparse_conv" tests/run_tests.py
168+
env:
169+
CUSTOM_OP_LIB: ${{ env.OPENVINO_REPO }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}/libuser_ov_extensions.so
170+
171+
- name: Upload Test Results
172+
uses: actions/upload-artifact@v4
173+
if: ${{ !cancelled() }}
174+
with:
175+
name: test-results-java
176+
path: ${{ env.OPENVINO_CONTRIB_REPO }}/modules/java_api/build/test-results
177+
if-no-files-found: 'warn'

.github/workflows/windows.yml

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

0 commit comments

Comments
 (0)