# Copyright Advanced Micro Devices, Inc. # SPDX-License-Identifier: MIT name: "Setup test environment" description: Setup ROCm test environment from built artifacts inputs: VENV_DIR: description: (string) Directory in which to create a Python virtual environment (e.g. `github.workspace/.venv`) required: true OUTPUT_ARTIFACTS_DIR: description: (string) Directory to download/unpack test artifacts into (e.g. `github.workspace/build`) required: true ARTIFACT_GROUP: description: (string) Artifact group (e.g. `gfx110X-all`) required: true AMDGPU_TARGETS: description: (string) Comma-separated individual GPU targets for fetching split artifacts (e.g. `gfx942`) default: "" ARTIFACT_RUN_ID: description: (string) Run ID to download artifacts from (`env.ARTIFACT_RUN_ID` or a value like `19716407405`) required: true FETCH_ARTIFACT_ARGS: description: (string) Extra arguments to install_rocm_from_artifacts.py (e.g. `--blas --tests`) RELEASE_TYPE: description: 'Release type: "ci", "dev", "nightly", or "prerelease"' default: ci runs: using: "composite" steps: - name: "Setting up Python" uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: 3.12 - name: "Install UV" shell: bash run: | pip install uv - name: Create Python venv shell: bash env: VENV_DIR: ${{ inputs.VENV_DIR }} run: | python build_tools/setup_venv.py ${VENV_DIR} \ --activate-in-future-github-actions-steps \ --use-uv - name: Install test requirements shell: bash run: | uv pip install -r requirements-test.txt uv pip freeze - name: Install Choco tools if: ${{ runner.os == 'Windows' }} shell: bash run: | choco install --no-progress -y ninja - name: Download and Unpack Artifacts shell: bash env: OUTPUT_ARTIFACTS_DIR: ${{ inputs.OUTPUT_ARTIFACTS_DIR }} ARTIFACT_GROUP: ${{ inputs.ARTIFACT_GROUP }} AMDGPU_TARGETS: ${{ inputs.AMDGPU_TARGETS }} ARTIFACT_RUN_ID: ${{ inputs.ARTIFACT_RUN_ID }} FETCH_ARTIFACT_ARGS: ${{ inputs.FETCH_ARTIFACT_ARGS }} RELEASE_TYPE: ${{ inputs.RELEASE_TYPE }} GITHUB_TOKEN: ${{ github.token }} STEP_NAME: "Download and Unpack Artifacts" STEP_TIMEOUT_TOLERANCE: "2" run: | python ./build_tools/install_rocm_from_artifacts.py \ --run-id=${ARTIFACT_RUN_ID} \ --artifact-group=${ARTIFACT_GROUP} \ --amdgpu-targets=${AMDGPU_TARGETS} \ --output-dir=${OUTPUT_ARTIFACTS_DIR} \ ${FETCH_ARTIFACT_ARGS}