use gh run download for win #1
This file contains hidden or 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: JAX Layer Tests | ||
| 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: | ||
| JAX_Layer_Tests: | ||
| name: JAX Layer Tests | ||
| timeout-minutes: 40 | ||
| 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" | ||
| 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: | ||
| # checkout action cleans up the workspace and have to be the first step | ||
| - 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: Install GH CLI | ||
| if: runner.os == 'Windows' | ||
| run: choco install gh | ||
| - name: Download and extract OpenVINO artifacts (tarballs) (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_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: 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' | ||
| - name: Install JAX Layer tests dependencies | ||
| run: | | ||
| # jax test requirements | ||
| python3 -m pip install -r ${{ env.INSTALL_TEST_DIR }}/requirements_jax | ||
| - name: JAX Layer Tests | ||
| if: ${{ fromJSON(inputs.affected-components).JAX_FE.test && runner.arch != 'ARM64' }} # Ticket: 126287, 142196 | ||
| run: python3 -m pytest ${{ env.INSTALL_TEST_DIR }}/layer_tests/jax_tests ${PARALLEL} -v -m precommit_jax_fe --junitxml=${{ env.INSTALL_TEST_DIR }}/TEST-jax.xml | ||
| env: | ||
| TEST_DEVICE: CPU | ||
| TEST_PRECISION: FP16 | ||
| JAX_TRACE_MODE: JAXPR | ||
| PARALLEL: ${{ runner.os == 'Windows' && ' ' || '-n logical'}} | ||
| - name: Upload Test Results | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||
| if: ${{ !cancelled() }} | ||
| with: | ||
| name: test-results-python-jax-layers | ||
| path: | | ||
| ${{ env.INSTALL_TEST_DIR }}/TEST*.html | ||
| ${{ env.INSTALL_TEST_DIR }}/TEST*.xml | ||
| if-no-files-found: 'warn' | ||