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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
name: Ryzen Modeling - Test | ||
on: | ||
workflow_call: | ||
inputs: | ||
pytest_marker: | ||
required: false | ||
type: string | ||
description: 'Pytest marker to execute (python -m paramater)' | ||
test_file: | ||
required: true | ||
type: string | ||
description: 'Pytest file to execute' | ||
report_name: | ||
default: false | ||
type: boolean | ||
description: 'Report name if you need to make reports' | ||
slow_test: | ||
default: false | ||
type: boolean | ||
description: 'Manage the varible env:RUN_SLOW value' | ||
secrets: | ||
HF_READ_TOKEN: | ||
required: false | ||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
runs-on: [self-hosted, single-npu, amd-npu, ryzenai] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Create and start a virtual environment | ||
run: | | ||
conda create --prefix venv --clone C:\tools\Anaconda3\envs\ryzenai-1.0.1-ci | ||
conda init | ||
conda activate .\venv | ||
#- name: Install dependencies | ||
# run: | | ||
# conda activate .\venv | ||
# python -m pip install --upgrade pip | ||
# pip install .[tests] | ||
# pip install git+https://github.com/huggingface/optimum.git | ||
- name: Test with Pytest | ||
env: | ||
MARKER: ${{ inputs.pytest_marker}} | ||
TEST_FILE: ${{ inputs.test_file}} | ||
REPORT_NAME: ${{ inputs.report_name}} | ||
SLOW_TEST: ${{ inputs.slow_test}} | ||
XLNX_VART_FIRMWARE: "C:\RyzenAiSw\\ryzen-ai-sw-1.0.1\\voe-4.0-win_amd64\\1x4.xclbin" | ||
run: | | ||
conda activate .\venv | ||
#$env:XLNX_VART_FIRMWARE="C:\RyzenAiSw\ryzen-ai-sw-1.0.1\voe-4.0-win_amd64\1x4.xclbin" | ||
if ( $SLOW_TEST ) { | ||
$env:RUN_SLOW=1; | ||
} | ||
if ( $REPORT_NAME ) { | ||
#pytest -s -vvvvv -m "$env:MARKER" "$env:TEST_FILE" | ||
$pytestcommand = 'pytest -s -vvvvv -m "$env:MARKER" "$env:TEST_FILE"' | ||
write-output $pytestcommand | ||
} | ||
else { | ||
#pytest -s -vvvvv -m "$env:MARKER" --make-reports="$env:REPORT_NAME" "$env:TEST_FILE" | ||
$pytestcommand = 'pytest -s -vvvvv -m "$env:MARKER" --make-reports="$env:REPORT_NAME" "$env:TEST_FILE"' | ||
write-output $pytestcommand | ||
} | ||
- name: Cleanup | ||
run: | | ||
rm -r .\venv |