|
29 | 29 | ov_artifact_name: ${{ steps.openvino_download.outputs.ov_artifact_name }} |
30 | 30 | ov_wheel_source: ${{ steps.openvino_download.outputs.ov_wheel_source }} |
31 | 31 | ov_version: ${{ steps.openvino_download.outputs.ov_version }} |
| 32 | + ov_latest_artifact_name: ${{ steps.openvino_latest_download.outputs.ov_artifact_name }} |
32 | 33 | timeout-minutes: 10 |
33 | 34 | defaults: |
34 | 35 | run: |
|
47 | 48 | platform: macos_12_6 |
48 | 49 | commit_packages_to_provide: wheels |
49 | 50 | revision: latest_nightly |
| 51 | + |
| 52 | + - uses: openvinotoolkit/openvino/.github/actions/openvino_provider@master |
| 53 | + id: openvino_latest_download |
| 54 | + with: |
| 55 | + platform: macos_12_6 |
| 56 | + commit_packages_to_provide: openvino_js_package.tar.gz |
| 57 | + revision: latest_available_commit |
50 | 58 |
|
51 | 59 | genai_build_cmake: |
52 | 60 | name: Build cpack - ${{ matrix.build-type }} |
@@ -268,7 +276,61 @@ jobs: |
268 | 276 | name: genai_samples_${{ matrix.build-type }} |
269 | 277 | path: ${{ env.INSTALL_DIR }} |
270 | 278 | if-no-files-found: 'error' |
271 | | - |
| 279 | + |
| 280 | + genai_build_nodejs: |
| 281 | + name: Build Node.js bindings |
| 282 | + strategy: |
| 283 | + fail-fast: false |
| 284 | + matrix: |
| 285 | + build-type: [Release] |
| 286 | + needs: [ openvino_download ] |
| 287 | + timeout-minutes: 30 |
| 288 | + defaults: |
| 289 | + run: |
| 290 | + shell: bash |
| 291 | + runs-on: macos-13 |
| 292 | + |
| 293 | + env: |
| 294 | + SRC_DIR: ${{ github.workspace }}/openvino.genai |
| 295 | + BUILD_DIR: ${{ github.workspace }}/build |
| 296 | + INSTALL_DIR: ${{ github.workspace }}/openvino.genai/src/js/bin |
| 297 | + OV_INSTALL_DIR: ${{ github.workspace }}/ov |
| 298 | + |
| 299 | + steps: |
| 300 | + - name: Clone openvino.genai |
| 301 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 302 | + with: |
| 303 | + submodules: recursive |
| 304 | + path: ${{ env.SRC_DIR }} |
| 305 | + |
| 306 | + - name: Download OpenVINO package |
| 307 | + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 |
| 308 | + with: |
| 309 | + name: ${{ needs.openvino_download.outputs.ov_latest_artifact_name }} |
| 310 | + path: ${{ env.OV_INSTALL_DIR }} |
| 311 | + merge-multiple: true |
| 312 | + |
| 313 | + - name: Install build dependencies |
| 314 | + run: brew install coreutils |
| 315 | + |
| 316 | + - name: Build GenAI Node.js bindings |
| 317 | + run: | |
| 318 | + source ${{ env.OV_INSTALL_DIR }}/setupvars.sh |
| 319 | + cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ |
| 320 | + -DENABLE_JS=ON -DCPACK_GENERATOR=NPM \ |
| 321 | + -DENABLE_PYTHON=OFF -DENABLE_WHEEL=OFF \ |
| 322 | + -S ${{ env.SRC_DIR }} -B ${{ env.BUILD_DIR }} |
| 323 | + cmake --build ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --parallel --verbose |
| 324 | + cmake --install ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --prefix ${{ env.INSTALL_DIR }} |
| 325 | +
|
| 326 | + - name: Upload Node.js bindings Build Package |
| 327 | + if: always() |
| 328 | + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 |
| 329 | + with: |
| 330 | + name: genai_nodejs_bindings |
| 331 | + path: ${{ env.INSTALL_DIR }} |
| 332 | + if-no-files-found: 'error' |
| 333 | + |
272 | 334 | genai_tests_wheel: |
273 | 335 | name: Python (${{ matrix.test.name}}) Tests (wheel) |
274 | 336 | needs: [ openvino_download, genai_build_wheel ] |
@@ -397,6 +459,74 @@ jobs: |
397 | 459 | SAMPLES_PY_DIR: "${{ env.INSTALL_DIR }}/samples/python" |
398 | 460 | SAMPLES_CPP_DIR: "${{ env.INSTALL_DIR }}/samples_bin" |
399 | 461 |
|
| 462 | + genai_nodejs_tests: |
| 463 | + name: Node.js bindings tests |
| 464 | + needs: [ openvino_download, genai_build_nodejs ] |
| 465 | + timeout-minutes: 20 |
| 466 | + defaults: |
| 467 | + run: |
| 468 | + shell: bash |
| 469 | + runs-on: macos-13 |
| 470 | + |
| 471 | + env: |
| 472 | + SRC_DIR: ${{ github.workspace }}/openvino.genai |
| 473 | + INSTALL_DIR: ${{ github.workspace }}/install |
| 474 | + NODE_VERSION: 21 |
| 475 | + |
| 476 | + steps: |
| 477 | + - name: Clone openvino.genai |
| 478 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 479 | + with: |
| 480 | + path: ${{ env.SRC_DIR }} |
| 481 | + submodules: recursive |
| 482 | + |
| 483 | + - name: Download OpenVINO Artifacts |
| 484 | + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 |
| 485 | + with: |
| 486 | + name: ${{ needs.openvino_download.outputs.ov_latest_artifact_name }} |
| 487 | + path: ${{ env.INSTALL_DIR }} |
| 488 | + merge-multiple: true |
| 489 | + |
| 490 | + - name: Download GenAI JS Bildings Artifacts |
| 491 | + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 |
| 492 | + with: |
| 493 | + name: genai_nodejs_bindings |
| 494 | + path: ${{ env.SRC_DIR }}/src/js/bin |
| 495 | + merge-multiple: true |
| 496 | + |
| 497 | + - name: Setup Node ${{ env.NODE_VERSION }} |
| 498 | + uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 |
| 499 | + with: |
| 500 | + node-version: ${{ env.NODE_VERSION }} |
| 501 | + |
| 502 | + # JS pacakges uses the OpenVINO and OpenVINO GenAI libraries from the bin directory. |
| 503 | + # Here we emulate the installation of the openvino-node package from NPM. The latest |
| 504 | + # release of the openvino-node package is installed, and we need to update the binaries |
| 505 | + # in the node_modules/openvino-node/bin directory to work correctly with GenAI |
| 506 | + - name: Install npm package tests dependencies |
| 507 | + working-directory: ${{ env.SRC_DIR }}/src/js |
| 508 | + run: | |
| 509 | + npm install --verbose |
| 510 | + rm -rf node_modules/openvino-node/bin |
| 511 | + cp -R ${{ env.INSTALL_DIR }}/openvino_js_package node_modules/openvino-node/bin |
| 512 | +
|
| 513 | + - name: Run npm package tests |
| 514 | + working-directory: ${{ env.SRC_DIR }}/src/js |
| 515 | + run: npm test |
| 516 | + |
| 517 | + - name: Install openvino-genai-node samples dependencies |
| 518 | + working-directory: ${{ env.SRC_DIR }}/samples/js/text_generation |
| 519 | + run: | |
| 520 | + npm install --verbose |
| 521 | + rm -rf node_modules/openvino-node/bin |
| 522 | + cp -R ${{ env.INSTALL_DIR }}/openvino_js_package node_modules/openvino-node/bin |
| 523 | +
|
| 524 | + - name: Run samples tests |
| 525 | + working-directory: ${{ env.SRC_DIR }}/samples/js/text_generation |
| 526 | + run: npm test |
| 527 | + env: |
| 528 | + MODEL_PATH: ${{ env.SRC_DIR }}/src/js/tests/models/Llama-3.1-8B-Instruct-FastDraft-150M-int8-ov |
| 529 | + |
400 | 530 | Overall_Status: |
401 | 531 | name: ci/gha_overall_status_macos |
402 | 532 | needs: [openvino_download, genai_build_cmake, genai_build_wheel, genai_build_samples, genai_tests_wheel, genai_samples_tests] |
|
0 commit comments