Skip to content

return download via an action for nix #2

return download via an action for nix

return download via an action for nix #2

name: TensorFlow Layer Tests

Check failure on line 1 in .github/workflows/job_tensorflow_layer_tests.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/job_tensorflow_layer_tests.yml

Invalid workflow file

(Line: 71, Col: 9): Unexpected value 'command'
on:
workflow_call:
inputs:
runner:
description: 'Machine on which the tests would run'
type: string
required: true
image:
description: 'Docker image to use for the job'
type: string
required: false
default: 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
required: true
permissions: read-all
env:
PIP_CACHE_PATH_LINUX: /mount/caches/pip/linux
PIP_CACHE_PATH_WIN: "C:\\mount\\caches\\pip\\win"
HF_HUB_CACHE_LIN: /mount/caches/huggingface
HF_HUB_CACHE_WIN: "C:\\mount\\caches\\huggingface"
jobs:
TensorFlow_Layer_Tests:
name: TensorFlow Layer Tests
timeout-minutes: 60
runs-on: ${{ inputs.runner }}
container:
image: ${{ inputs.image }}
volumes:
- /mount:/mount
- ${{ github.workspace }}:${{ github.workspace }} # Needed as ${{ github.workspace }} is not working correctly when using Docker
options: "-e HF_TOKEN" # Needed for HuggingFace cache authentication
defaults:
run:
shell: ${{ contains(inputs.runner, 'win') && 'pwsh' || 'bash' }}
env:
DEBIAN_FRONTEND: noninteractive # to prevent apt-get from waiting user input
INSTALL_DIR: ${{ github.workspace }}/install
INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests
USE_SYSTEM_CACHE: False # Using remote HuggingFace cache
steps:
- name: Install GH CLI
if: runner.os == 'Windows'
run: choco install gh
- name: Fetch custom actions
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
timeout-minutes: 15
with:
sparse-checkout: |
.github/actions
sparse-checkout-cone-mode: false
submodules: 'false'
- name: Download and extract OpenVINO artifacts (tarballs, wheels, tokenizers) (Win)
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
if: runner.os == 'Windows'
with:
timeout_minutes: 5
max_attempts: 2
command: |
# Add `gh` to PATH
$env:GH_TOKEN = "${{ github.token }}"
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
gh run download "$env:GITHUB_RUN_ID" --repo "$env:GITHUB_REPOSITORY" -n openvino_wheels --dir ${{ env.INSTALL_DIR }} && `
gh run download "$env:GITHUB_RUN_ID" --repo "$env:GITHUB_REPOSITORY" -n openvino_tokenizers_wheel --dir ${{ env.INSTALL_DIR }} && `
gh run download "$env:GITHUB_RUN_ID" --repo "$env:GITHUB_REPOSITORY" -n openvino_tests --dir ${{ env.INSTALL_DIR }}
pushd ${{ env.INSTALL_DIR }}
Expand-Archive openvino_tests.zip -DestinationPath . -Verbose
popd
- name: Setup Variables
run: |
echo "HF_HUB_CACHE=${{ runner.os == 'Linux' && env.HF_HUB_CACHE_LIN || env.HF_HUB_CACHE_WIN }}" >> "$GITHUB_ENV"
- name: Install OpenVINO dependencies (mac)
if: ${{ runner.os == 'macOS' }}
run: brew install pigz
- name: Download OpenVINO artifacts (wheels)
if: runner.os != 'Windows'
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: openvino_wheels
path: ${{ env.INSTALL_DIR }}
- name: Download OpenVINO artifacts (tests)
if: runner.os != 'Windows'
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: openvino_tests
path: ${{ env.INSTALL_DIR }}
- name: Extract OpenVINO packages (Linux, macOS)
if: ${{ runner.os != 'Windows' }}
run: pigz -dc openvino_tests.tar.gz | tar -xf - -v
working-directory: ${{ env.INSTALL_DIR }}
- name: Setup Python ${{ inputs.python-version }}
uses: ./.github/actions/setup_python
with:
version: ${{ inputs.python-version }}
pip-cache-path: ${{ runner.os == 'Linux' && env.PIP_CACHE_PATH_LINUX || env.PIP_CACHE_PATH_WIN }}
should-setup-pip-paths: ${{ runner.os != 'macOS' }}
self-hosted-runner: ${{ runner.os != 'macOS' }}
- name: Install OpenVINO Python wheels
uses: ./.github/actions/install_ov_wheels
with:
wheels-dir-path: ${{ env.INSTALL_DIR }}
wheels-to-install: 'openvino openvino_tokenizers'
- name: Install Python Layer tests dependencies
run: |
# tensorflow test requirements
python3 -m pip install -r ${{ env.INSTALL_TEST_DIR }}/requirements_tensorflow
- name: TensorFlow 1 Layer Tests - TF FE
if: ${{ fromJSON(inputs.affected-components).TF_FE.test }}
run: |
python3 -m pytest ${{ env.INSTALL_TEST_DIR }}/layer_tests/tensorflow_tests/ -v -n logical -m precommit --junitxml=${{ env.INSTALL_TEST_DIR }}/TEST-tf_fe.xml
env:
TEST_DEVICE: CPU
TEST_PRECISION: FP16
- name: TensorFlow 2 Layer Tests - TF FE
if: ${{ fromJSON(inputs.affected-components).TF_FE.test && runner.os != 'macOS' }} # Ticket: 123322
run: |
python3 -m pytest ${{ env.INSTALL_TEST_DIR }}/layer_tests/tensorflow2_keras_tests/ -v -n logical -m precommit --junitxml=${{ env.INSTALL_TEST_DIR }}/TEST-tf2_fe.xml
env:
TEST_DEVICE: CPU
TEST_PRECISION:
- name: Upload Test Results
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: ${{ !cancelled() }}
with:
name: test-results-python-tf-layers
path: |
${{ env.INSTALL_TEST_DIR }}/TEST*.html
${{ env.INSTALL_TEST_DIR }}/TEST*.xml
if-no-files-found: 'warn'