102 lines
3.7 KiB
YAML
102 lines
3.7 KiB
YAML
name: ONNX Models 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}'
|
|
|
|
permissions: read-all
|
|
|
|
jobs:
|
|
ONNX_Models_tests:
|
|
name: ONNX Models tests
|
|
timeout-minutes: 60
|
|
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
|
|
ONNX_MODELS_PATH: ${{ github.workspace }}/onnx_test_models
|
|
# instead of using static MODELS_SHARE_PATH
|
|
# choose one of the replicas dynamically instead
|
|
# depending on GITHUB_RUN_NUMBER variable
|
|
NUMBER_OF_REPLICAS: 2
|
|
ONNX_MODEL_ZOO_SHA: "5faef4c33eba0395177850e1e31c4a6a9e634c82"
|
|
if: ${{ github.event_name != 'merge_group' }}
|
|
steps:
|
|
- name: Download OpenVINO package
|
|
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
|
|
with:
|
|
name: openvino_package
|
|
path: ${{ env.INSTALL_DIR }}
|
|
|
|
- name: Download OpenVINO tests package
|
|
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
|
|
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"
|
|
echo "MODELS_SHARE_PATH=/mount/testdata$((GITHUB_RUN_NUMBER % NUMBER_OF_REPLICAS))" >> "$GITHUB_ENV"
|
|
echo $MODELS_SHARE_PATH
|
|
|
|
- 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 model_zoo_preprocess script
|
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
|
with:
|
|
sparse-checkout: |
|
|
src/frontends/onnx/tests/tests_python/model_zoo_preprocess.sh
|
|
sparse-checkout-cone-mode: false
|
|
path: 'openvino'
|
|
|
|
- name: Update Models
|
|
run: bash ${OPENVINO_REPO}/src/frontends/onnx/tests/tests_python/model_zoo_preprocess.sh -d ${MODELS_SHARE_PATH} -o -s "${{ env.ONNX_MODEL_ZOO_SHA }}"
|
|
|
|
- name: Install OpenVINO Python wheels
|
|
run: |
|
|
# Install the core OV wheel
|
|
python3 -m pip install ${INSTALL_DIR}/tools/openvino-*.whl
|
|
|
|
extras_to_install="onnx"
|
|
|
|
# Find and install OV dev wheel
|
|
pushd ${INSTALL_DIR}/tools
|
|
ov_dev_wheel_name=$(find . -name 'openvino_dev*.whl')
|
|
python3 -m pip install $ov_dev_wheel_name[$extras_to_install]
|
|
popd
|
|
|
|
- name: Install Python tests dependencies
|
|
run: |
|
|
# To enable pytest parallel features
|
|
python3 -m pip install pytest-xdist[psutil] pytest-forked
|
|
|
|
- name: ONNX Models Tests
|
|
run: python3 -m pytest --backend="CPU" --model_zoo_dir="${MODELS_SHARE_PATH}" ${INSTALL_TEST_DIR}/onnx/tests/tests_python/test_zoo_models.py -v -n auto --forked -k 'not _cuda' --model_zoo_xfail
|