Update tests #172
Workflow file for this run
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
name: genai_python_lib | |
on: pull_request | |
jobs: | |
ubuntu_genai_python_lib: | |
# A tokenizers' dependency fails to compile on ubuntu-20 n CenOS7 env. | |
runs-on: ubuntu-22.04 | |
env: | |
# A tokenizers' dependency fails to compile with Ninja in CenOS7 env. | |
CMAKE_GENERATOR: Unix Makefiles | |
CMAKE_BUILD_PARALLEL_LEVEL: null | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- run: mkdir ./ov/ | |
# Install CentOS7 instead of Ubuntu to match PyPI distribution ABI | |
- run: curl https://storage.openvinotoolkit.org/repositories/openvino/packages/pre-release/2024.2.0rc1/linux/l_openvino_toolkit_centos7_2024.2.0.dev20240524_x86_64.tgz | tar --directory ./ov/ --strip-components 1 -xz | |
- run: sudo ./ov/install_dependencies/install_openvino_dependencies.sh | |
- run: source ./ov/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/ | |
- run: source ./ov/setupvars.sh && cmake --build ./build/ --config Release -j | |
# GitHub Actions already provides what is listed in ./requirements-build.txt but the internal | |
# build system doesn't. Install ./requirements-build.txt to detect possible conflicts. | |
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./requirements-build.txt -r ./tests/python_tests/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release | |
# The tests can convert the model themselves, but underlying OpenVINO silently saves empty .xml if there's no space. | |
- run: source ./ov/setupvars.sh && optimum-cli export openvino --trust-remote-code --weight-format fp16 --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0 | |
# --exitfirst to exit instantly on first error because tests are slow and produce lots of logs slowing down GitHub Actions logs view. | |
- run: source ./ov/setupvars.sh && PYTHONPATH=./build/:$PYTHONPATH python -m pytest ./tests/python_tests/test_generate_api.py --exitfirst -m precommit | |
- run: source ./ov/setupvars.sh && python -m pip install . --config-settings=build-dir="build" --verbose | |
- run: python -m pytest ./tests/python_tests/test_generate_api.py --exitfirst -m precommit | |
windows_genai_python_lib: | |
runs-on: windows-latest | |
env: | |
CMAKE_BUILD_PARALLEL_LEVEL: null | |
defaults: | |
run: | |
shell: cmd | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- run: curl --output ov.zip https://storage.openvinotoolkit.org/repositories/openvino/packages/pre-release/2024.2.0rc1/windows/w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64.zip | |
- run: unzip ov.zip | |
# GitHub Actions already provides what is listed in ./requirements-build.txt but the internal | |
# build system doesn't. Install ./requirements-build.txt to detect possible conflicts. | |
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64\setupvars.bat && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/ | |
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64\setupvars.bat && cmake --build ./build/ --config Release -j | |
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64\setupvars.bat && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./requirements-build.txt -r ./tests/python_tests/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release | |
# cmd evaluates variables in a different way. Setting PYTHONPATH before setupvars.bat instead of doing that after solves that. | |
- run: set "PYTHONPATH=./build/" && call w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64\setupvars.bat && python -m pytest ./tests/python_tests/test_generate_api.py --exitfirst -m precommit | |
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64\setupvars.bat && python -m pip install . --config-settings=build-dir="build" --verbose | |
- run: python -m pytest ./tests/python_tests/test_generate_api.py --exitfirst -m precommit |