1- name : Linux Build MLIR and Unit tests
1+ name : Linux MLIR
22on :
33 workflow_call :
44 inputs :
5- runner :
6- description : ' Machine on which the tests would run'
5+ build- runner :
6+ description : ' Machine on which the builds will run'
77 type : string
88 required : true
9+ test-runner :
10+ description : ' Machine on which the tests will run'
11+ type : string
12+ required : false
13+ openvino-cmake-options :
14+ description : ' A string of options passed to OpenVINO CMake'
15+ type : string
16+ required : false
17+ npu-cmake-options :
18+ description : ' A string of options passed to NPU Compiler CMake'
19+ type : string
20+ required : false
21+ run-tests :
22+ description : ' Whether to run NPU Compiler tests'
23+ type : boolean
24+ required : false
25+ default : false
26+ run-unit-tests :
27+ description : ' Whether to run NPU Compiler unit tests'
28+ type : boolean
29+ required : false
30+ default : true
31+ run-lit-tests :
32+ description : ' Whether to run NPU Compiler LIT tests'
33+ type : boolean
34+ required : false
35+ default : true
936
1037permissions : read-all
1138
1441
1542jobs :
1643 Build :
17- name : Build MLIR and Unit tests
44+ name : Build
45+ runs-on : ${{ inputs.build-runner }}
1846 timeout-minutes : 240
19- runs-on : ${{ inputs.runner }}
2047 defaults :
2148 run :
2249 shell : bash
2552 CMAKE_BUILD_TYPE : ' Release'
2653 OPENVINO_REPO : ./openvino
2754 NPU_COMPILER_REPO : ./npu_compiler
28- OPENVINO_INSTALL_DIR : ./openvino_install
2955 OPENVINO_BUILD_DIR : ./openvino_build
3056 NPU_COMPILER_BUILD_DIR : ./npu_compiler_build
57+ OPENVINO_INSTALL_DIR : ./openvino_install
3158 steps :
3259 - name : Clone NPU Compiler
3360 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -67,12 +94,22 @@ jobs:
6794 python3 -m pip install -r ${OPENVINO_REPO}/src/frontends/tensorflow_lite/tests/requirements.txt
6895 python3 -m pip install -r ${OPENVINO_REPO}/src/frontends/paddle/tests/requirements.txt
6996
97+ - name : Prepare environment
98+ run : |
99+ if [[ "${{ inputs.run-tests }}" == "true" ]]; then
100+ echo "ENABLE_TESTS_FLAG=ON" >> $GITHUB_ENV
101+ else
102+ echo "ENABLE_TESTS_FLAG=OFF" >> $GITHUB_ENV
103+ fi
104+
70105 - name : CMake configure - OpenVINO
71106 run : |
72107 cmake \
108+ ${{ inputs.openvino-cmake-options }} \
109+ -G "Ninja Multi-Config" \
73110 -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} \
74111 -DENABLE_LTO=OFF \
75- -DENABLE_TESTS=ON \
112+ -DENABLE_TESTS=${{ env.ENABLE_TESTS_FLAG }} \
76113 -DENABLE_INTEL_CPU=ON \
77114 -DENABLE_INTEL_GPU=ON \
78115 -DENABLE_INTEL_NPU=ON \
@@ -110,13 +147,16 @@ jobs:
110147 cmake --install ${OPENVINO_BUILD_DIR} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${OPENVINO_INSTALL_DIR}
111148 cmake --install ${OPENVINO_BUILD_DIR} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${OPENVINO_INSTALL_DIR} --component python_wheels
112149 cmake --install ${OPENVINO_BUILD_DIR} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${OPENVINO_INSTALL_DIR} --component tests
150+ cmake --install ${OPENVINO_BUILD_DIR} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${OPENVINO_DEV_PACKAGE_DIR} --component developer_package
113151
114152 - name : CMake configure - NPU Compiler
115153 run : |
116154 cmake \
155+ ${{ inputs.npu-cmake-options }} \
156+ -G "Ninja Multi-Config" \
117157 -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} \
118- -DOpenVINODeveloperPackage_DIR=$(realpath ${OPENVINO_BUILD_DIR}) \
119- -DENABLE_TESTS=ON \
158+ -DOpenVINODeveloperPackage_DIR=$(realpath ${OPENVINO_DEV_PACKAGE_DIR})/developer_package/cmake \
159+ -DENABLE_TESTS=${{ env.ENABLE_TESTS_FLAG }} \
120160 -DENABLE_DEVELOPER_BUILD=OFF \
121161 -DENABLE_MLIR_COMPILER=ON \
122162 -DBUILD_COMPILER_FOR_DRIVER=OFF \
@@ -134,15 +174,43 @@ jobs:
134174 cmake --install ${NPU_COMPILER_BUILD_DIR} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${OPENVINO_INSTALL_DIR}
135175 cmake --install ${NPU_COMPILER_BUILD_DIR} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${OPENVINO_INSTALL_DIR} --component tests
136176
177+ - name : Upload artifacts
178+ id : save_artifact
179+ uses : actions/upload-artifact@v4
180+ with :
181+ name : build-output-${{ github.sha }}-${{ github.job }}-${{ github.run_number }}
182+ path : ${{ env.OPENVINO_INSTALL_DIR }}
183+
184+ Test :
185+ name : Unit Tests
186+ needs : Build
187+ if : ${{ inputs.run-tests }}
188+ runs-on : ${{ inputs.test-runner }}
189+ timeout-minutes : 240
190+ env :
191+ OPENVINO_INSTALL_DIR : ./openvino_install
192+ defaults :
193+ run :
194+ shell : bash
195+ steps :
196+ - name : Download artifacts
197+ uses : actions/download-artifact@v4
198+ with :
199+ name : build-output-${{ github.sha }}-${{ github.job }}-${{ github.run_number }}
200+ path : ${{ env.OPENVINO_INSTALL_DIR }}
201+
137202 - name : Run OV NPU Unit tests
203+ if : ${{ inputs.run-unit-tests }}
138204 run : |
139205 ${OPENVINO_INSTALL_DIR}/tests/ov_npu_unit_tests
140206
141207 - name : Run NPU Unit tests
208+ if : ${{ inputs.run-unit-tests }}
142209 run : |
143210 ${OPENVINO_INSTALL_DIR}/tests/npuUnitTests
144211
145212 - name : Run NPU LIT tests
213+ if : ${{ inputs.run-lit-tests }}
146214 run : |
147215 export PATH=$PATH:${OPENVINO_INSTALL_DIR}/tools/prof_parser
148216 export PATH=$PATH:${OPENVINO_INSTALL_DIR}/tools/npu-loader
0 commit comments