# Copyright Advanced Micro Devices, Inc. # SPDX-License-Identifier: MIT name: Test Artifact Structure on: workflow_dispatch: inputs: artifact_run_id: type: string description: "Run ID to fetch artifacts from (defaults to current run)" default: "" artifact_github_repo: description: "GitHub repository for artifact_run_id" type: string default: ROCm/TheRock amdgpu_families: description: "amdgpu_families as a semicolon-separated list (e.g. 'gfx94X-dcgpu;gfx120X-all')" type: string default: "" platform: type: choice description: "Platform to fetch artifacts for" options: - linux - windows default: "linux" release_type: description: 'Release type: "ci" or "dev"' type: choice options: - ci - dev default: ci repository: description: "Repository to checkout. Defaults to github.repository." type: string ref: description: "Branch, tag, or SHA to checkout. Defaults to the triggering ref." type: string workflow_call: inputs: artifact_run_id: type: string default: "" artifact_github_repo: type: string default: "" amdgpu_families: type: string default: "" platform: type: string default: "linux" release_type: type: string default: ci repository: description: "Repository to checkout. Defaults to github.repository." type: string ref: description: "Branch, tag, or SHA to checkout. Defaults to the triggering ref." type: string permissions: contents: read jobs: test_artifact_structure: name: "Validate artifact structure" runs-on: ${{ github.repository_owner == 'ROCm' && 'aws-linux-scale-rocm-prod-rc' || 'ubuntu-24.04' }} container: image: python:3.12-slim env: ARTIFACT_RUN_ID: "${{ inputs.artifact_run_id != '' && inputs.artifact_run_id || github.run_id }}" PLATFORM: ${{ inputs.platform }} THEROCK_ARTIFACTS_DIR: ${{ github.workspace }}/.download_cache RELEASE_TYPE: ${{ inputs.release_type }} steps: - name: Checkout repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: ${{ inputs.repository || github.repository }} ref: ${{ inputs.ref }} - name: Install test requirements run: | pip install -r requirements-test.txt - name: Fetch artifact archives (no extract) env: GITHUB_TOKEN: ${{ github.token }} run: | python ./build_tools/artifact_manager.py fetch \ --run-id="${{ env.ARTIFACT_RUN_ID }}" \ --run-github-repo="${{ inputs.artifact_github_repo }}" \ --stage=all \ --amdgpu-families="${{ inputs.amdgpu_families }}" \ --platform="${{ env.PLATFORM }}" \ --output-dir="${GITHUB_WORKSPACE}" \ --no-extract # NOTE: artifact_manager.py appends /.download_cache to --output-dir # in --no-extract mode, so pass workspace root here so that # artifacts land in THEROCK_ARTIFACTS_DIR ($workspace/.download_cache). - name: Validate artifact structure run: | python -m pytest tests/test_artifact_structure.py \ -v --log-cli-level=info --timeout=300