From 87370fe7723831316a216189cc808f409a98ad52 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 18 Dec 2024 11:01:51 +0100 Subject: [PATCH] [GHA] Enabled snippets tests in smart CI (#28096) ### Details: Addressed CI issue from https://github.com/openvinotoolkit/openvino/pull/28035 ### Tickets: - *[159467](https://jira.devtools.intel.com/browse/CVS-159467)* --- .github/components.yml | 7 +++++++ .github/labeler.yml | 4 +++- .github/workflows/job_python_api_tests.yml | 11 +++++++++-- .github/workflows/linux_arm64.yml | 2 +- .github/workflows/mac.yml | 2 +- .github/workflows/mac_arm64.yml | 2 +- .github/workflows/manylinux_2014.yml | 2 +- .github/workflows/ubuntu_22.yml | 2 +- .github/workflows/ubuntu_24.yml | 2 +- 9 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.github/components.yml b/.github/components.yml index 74247e1f051cd5..31952e2b87c114 100644 --- a/.github/components.yml +++ b/.github/components.yml @@ -175,6 +175,7 @@ Python_API: - OVC - tools - TF_FE + - docs_snippets build: - CPU - HETERO @@ -243,6 +244,12 @@ tools: docs: revalidate: [] build: [] + +docs_snippets: + revalidate: + - docs_snippets + build: + - Python_API licensing: revalidate: [] diff --git a/.github/labeler.yml b/.github/labeler.yml index e9b2acb26c9072..cb05d3dea36960 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -57,10 +57,12 @@ 'category: docs': - '**/*.md' - any: ['docs/**/*', - '!docs/snippets/**/*'] + '!docs/snippets/**/*', + '!docs/articles_en/assets/snippets/**/*'] 'category: docs_snippets': - 'docs/snippets/**/*' +- 'docs/articles_en/assets/snippets/**/*' 'category: extensions': - 'src/core/include/openvino/core/extension.hpp' diff --git a/.github/workflows/job_python_api_tests.yml b/.github/workflows/job_python_api_tests.yml index 81092db2bb808c..e12001cd67afba 100644 --- a/.github/workflows/job_python_api_tests.yml +++ b/.github/workflows/job_python_api_tests.yml @@ -12,6 +12,10 @@ on: type: string required: false default: '{"image": null}' + affected-components: + description: 'Components that are affected by changes in the commit defined by the Smart CI Action' + type: string + required: true python-version: description: 'Python version to setup. E.g., "3.11"' type: string @@ -25,6 +29,7 @@ env: jobs: Python_Unit_Tests: name: Python API tests + if: ${{ fromJSON(inputs.affected-components).Python_API.test || fromJSON(inputs.affected-components).docs_snippets.test }} timeout-minutes: 30 runs-on: ${{ inputs.runner }} container: ${{ fromJSON(inputs.container) }} @@ -95,6 +100,7 @@ jobs: # - name: Python API Tests + if: fromJSON(inputs.affected-components).Python_API.test run: | # for 'template' extension export LD_LIBRARY_PATH=${INSTALL_TEST_DIR}/tests/:$LD_LIBRARY_PATH @@ -103,6 +109,7 @@ jobs: --ignore=${INSTALL_TEST_DIR}/tests/pyopenvino/tests/test_utils/test_utils.py - name: Python API Tests -- numpy<2.0.0 + if: fromJSON(inputs.affected-components).Python_API.test run: | python3 -m pip uninstall -y numpy python3 -m pip install "numpy~=1.26.0" @@ -114,7 +121,7 @@ jobs: --ignore=${INSTALL_TEST_DIR}/tests/pyopenvino/tests/test_utils/test_utils.py - name: Clone API snippets - if: runner.os != 'macOS' + if: ${{ runner.os != 'macOS' && fromJSON(inputs.affected-components).docs_snippets.test }} uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 timeout-minutes: 15 with: @@ -123,7 +130,7 @@ jobs: submodules: 'false' - name: Docs Python snippets - if: runner.os != 'macOS' + if: ${{ runner.os != 'macOS' && fromJSON(inputs.affected-components).docs_snippets.test }} run: | # torch, onnx python3 -m pip install -r ${INSTALL_TEST_DIR}/tests/python/preprocess/torchvision/requirements.txt -r ${INSTALL_TEST_DIR}/tests/requirements_onnx diff --git a/.github/workflows/linux_arm64.yml b/.github/workflows/linux_arm64.yml index 9ca6c5461a62ea..66e825e5d5e126 100644 --- a/.github/workflows/linux_arm64.yml +++ b/.github/workflows/linux_arm64.yml @@ -179,8 +179,8 @@ jobs: with: runner: 'aks-linux-16-cores-arm' container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_20_04_arm64 }}", "volumes": ["/mount:/mount"]}' + affected-components: ${{ needs.smart_ci.outputs.affected_components }} python-version: '3.11' - if: fromJSON(needs.smart_ci.outputs.affected_components).Python_API.test TensorFlow_Layer_Tests: name: TensorFlow Layer Tests diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 94460a2721b60f..5e4335b8151c02 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -326,8 +326,8 @@ jobs: python-version: [ '3.9', '3.10', '3.11', '3.12' ] with: runner: 'macos-13' + affected-components: ${{ needs.smart_ci.outputs.affected_components }} python-version: ${{ matrix.python-version }} - if: fromJSON(needs.smart_ci.outputs.affected_components).Python_API.test Python_Unit_Tests: name: Python unit tests diff --git a/.github/workflows/mac_arm64.yml b/.github/workflows/mac_arm64.yml index 3340ce62e0104f..855d76973cc2e4 100644 --- a/.github/workflows/mac_arm64.yml +++ b/.github/workflows/mac_arm64.yml @@ -334,8 +334,8 @@ jobs: python-version: [ '3.9', '3.10', '3.11', '3.12' ] with: runner: 'macos-13-xlarge' + affected-components: ${{ needs.smart_ci.outputs.affected_components }} python-version: ${{ matrix.python-version }} - if: fromJSON(needs.smart_ci.outputs.affected_components).Python_API.test TensorFlow_Layer_Tests: name: TensorFlow Layer Tests diff --git a/.github/workflows/manylinux_2014.yml b/.github/workflows/manylinux_2014.yml index 4b5fc137c1504e..d6b3daa12abb57 100644 --- a/.github/workflows/manylinux_2014.yml +++ b/.github/workflows/manylinux_2014.yml @@ -266,8 +266,8 @@ jobs: with: runner: 'aks-linux-4-cores-16gb' container: '{"image": "${{ matrix.image }}", "volumes": ["/mount:/mount"]}' + affected-components: ${{ needs.smart_ci.outputs.affected_components }} python-version: ${{ matrix.python-version }} - if: fromJSON(needs.smart_ci.outputs.affected_components).Python_API.test Overall_Status: name: ci/gha_overall_status_manylinux2014 diff --git a/.github/workflows/ubuntu_22.yml b/.github/workflows/ubuntu_22.yml index d749164abbefd0..5aed74bbb242b8 100644 --- a/.github/workflows/ubuntu_22.yml +++ b/.github/workflows/ubuntu_22.yml @@ -311,8 +311,8 @@ jobs: with: runner: 'aks-linux-4-cores-16gb' container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_22_04_x64 }}", "volumes": ["/mount:/mount"]}' + affected-components: ${{ needs.smart_ci.outputs.affected_components }} python-version: '3.11' - if: fromJSON(needs.smart_ci.outputs.affected_components).Python_API.test TensorFlow_Layer_Tests: name: TensorFlow Layer Tests diff --git a/.github/workflows/ubuntu_24.yml b/.github/workflows/ubuntu_24.yml index 2c76149ecdcb94..25be095e692d35 100644 --- a/.github/workflows/ubuntu_24.yml +++ b/.github/workflows/ubuntu_24.yml @@ -143,8 +143,8 @@ jobs: with: runner: 'aks-linux-4-cores-16gb' container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64 }}", "volumes": ["/mount:/mount"]}' + affected-components: ${{ needs.smart_ci.outputs.affected_components }} python-version: '3.12' - if: fromJSON(needs.smart_ci.outputs.affected_components).Python_API.test Pytorch_Layer_Tests: name: Pytorch Layer Tests