-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CI] [GHA] Introduce additional Python (3.9-3.12) API tests on Ubuntu 22 #26897
Closed
akashchi
wants to merge
23
commits into
openvinotoolkit:master
from
akashchi:ci/gha/python-versions-tests-ubuntu-22
Closed
Changes from 2 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
7671ec3
add other pythons to dockefile, build all wheels
akashchi fd453a3
update docker tag
akashchi 0248236
add missing arg
akashchi 9c1efc5
find right wheel
akashchi 74595fb
find right wheels in other jobs
akashchi 5d454cd
add missing installations
akashchi 751861c
adapt for win
akashchi e8c0d26
correct win path
akashchi 02399bb
try via action
akashchi abe4167
use for win
akashchi 9d4569b
transition to action
akashchi cde45e3
merge
akashchi c64c70e
add python ut matrix
akashchi 1f47373
fix artefact name; fix install wheels inputs
akashchi 5abd049
skip to check other steps
akashchi cea717c
extract python api tests into a reusable job
akashchi 8c45a7c
Merge remote-tracking branch 'upstream/master' into ci/gha/python-ver…
akashchi 5c72d2e
fix arg
akashchi d591a25
add to other workflows, mv docs snippets
akashchi 0634015
Merge remote-tracking branch 'upstream/master' into ci/gha/python-ver…
akashchi 34b0546
merge
akashchi 85720da
Merge branch 'master' into ci/gha/python-versions-tests-ubuntu-22
akashchi 53ad1d5
Merge branch 'master' into ci/gha/python-versions-tests-ubuntu-22
akashchi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
name: OpenVINO Python API tests | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
runner: | ||
description: 'Machine on which the tests would run' | ||
type: string | ||
required: true | ||
container: | ||
description: 'JSON to be converted to the value of the "container" configuration for the job' | ||
type: string | ||
required: false | ||
default: '{"image": null}' | ||
python-version: | ||
description: 'Python version to setup. E.g., "3.11"' | ||
type: string | ||
required: true | ||
|
||
permissions: read-all | ||
|
||
env: | ||
PIP_CACHE_PATH: /mount/caches/pip/linux | ||
|
||
jobs: | ||
Python_Unit_Tests: | ||
name: OpenVINO Python API tests | ||
timeout-minutes: 30 | ||
runs-on: ${{ inputs.runner }} | ||
container: ${{ fromJSON(inputs.container) }} | ||
defaults: | ||
run: | ||
shell: bash | ||
env: | ||
DEBIAN_FRONTEND: noninteractive # to prevent apt-get from waiting user input | ||
OPENVINO_REPO: ${{ github.workspace }}/openvino | ||
INSTALL_DIR: ${{ github.workspace }}/install | ||
INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests | ||
steps: | ||
|
||
- name: Download OpenVINO package | ||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
with: | ||
name: openvino_package | ||
path: ${{ env.INSTALL_DIR }} | ||
|
||
- name: Download OpenVINO tests package | ||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
with: | ||
name: openvino_tests | ||
path: ${{ env.INSTALL_TEST_DIR }} | ||
|
||
# Needed as ${{ github.workspace }} is not working correctly when using Docker | ||
- name: Setup Variables | ||
run: | | ||
echo "OPENVINO_REPO=$GITHUB_WORKSPACE/openvino" >> "$GITHUB_ENV" | ||
echo "INSTALL_DIR=$GITHUB_WORKSPACE/install" >> "$GITHUB_ENV" | ||
echo "INSTALL_TEST_DIR=$GITHUB_WORKSPACE/install/tests" >> "$GITHUB_ENV" | ||
|
||
- name: Extract OpenVINO packages | ||
run: | | ||
pushd $INSTALL_DIR | ||
tar -xzf openvino_package.tar.gz -C $INSTALL_DIR | ||
popd | ||
pushd $INSTALL_TEST_DIR | ||
tar -xzf openvino_tests.tar.gz -C $INSTALL_DIR | ||
popd | ||
|
||
- name: Fetch setup_python and install wheels actions | ||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | ||
with: | ||
sparse-checkout: | | ||
.github/actions/setup_python/action.yml | ||
.github/actions/install_ov_wheels/action.yml | ||
sparse-checkout-cone-mode: false | ||
path: 'action_root' | ||
|
||
- name: Setup Python ${{ inputs.python-version }} | ||
uses: ./action_root/.github/actions/setup_python | ||
with: | ||
version: ${{ inputs.python-version }} | ||
pip-cache-path: ${{ runner.os == 'Linux' && env.PIP_CACHE_PATH || '' }} | ||
should-setup-pip-paths: ${{ runner.os == 'Linux' }} | ||
self-hosted-runner: ${{ runner.os == 'Linux' }} | ||
|
||
# | ||
# Tests | ||
# | ||
- name: Install OpenVINO Python wheels | ||
uses: ./action_root/.github/actions/install_ov_wheels | ||
with: | ||
install-dir-path: ${{ env.INSTALL_DIR }} | ||
install-core-wheel: true | ||
install-dev-wheel: true | ||
extras-to-install: 'caffe,kaldi,onnx,tensorflow2,pytorch' | ||
install-tokenizers-wheel: false | ||
|
||
- name: Install Python API tests dependencies | ||
run: python3 -m pip install -r ${INSTALL_TEST_DIR}/bindings/python/requirements_test.txt | ||
|
||
# | ||
# Tests | ||
# | ||
|
||
- name: Python API Tests | ||
run: | | ||
# for 'template' extension | ||
export LD_LIBRARY_PATH=${INSTALL_TEST_DIR}:$LD_LIBRARY_PATH | ||
python3 -m pytest -sv ${INSTALL_TEST_DIR}/pyopenvino \ | ||
--junitxml=${INSTALL_TEST_DIR}/TEST-Pyngraph.xml \ | ||
--ignore=${INSTALL_TEST_DIR}/pyopenvino/tests/test_utils/test_utils.py | ||
|
||
- name: Python API Tests -- numpy>=2.0.0 | ||
run: | | ||
python3 -m pip uninstall -y numpy | ||
python3 -m pip install "numpy>=2.0.0,<2.1.0" | ||
python3 -m pip install -r ${INSTALL_TEST_DIR}/bindings/python/requirements_test.txt | ||
# for 'template' extension | ||
export LD_LIBRARY_PATH=${INSTALL_TEST_DIR}:$LD_LIBRARY_PATH | ||
python3 -m pytest -sv ${INSTALL_TEST_DIR}/pyopenvino \ | ||
--junitxml=${INSTALL_TEST_DIR}/TEST-Pyngraph_new_numpy.xml \ | ||
--ignore=${INSTALL_TEST_DIR}/pyopenvino/tests/test_utils/test_utils.py | ||
|
||
- name: Upload Test Results | ||
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: test-results-python-api-${{ inputs.python-version }} | ||
path: | | ||
${{ env.INSTALL_TEST_DIR }}/TEST*.html | ||
${{ env.INSTALL_TEST_DIR }}/TEST*.xml | ||
if-no-files-found: 'warn' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can also include
Docs Python snippets
to.github/workflows/job_python_api_tests.yml
? As they test OpenVINO API code snippets