# Copyright Advanced Micro Devices, Inc. # SPDX-License-Identifier: MIT name: Test Artifacts on: workflow_dispatch: inputs: artifact_group: type: string artifact_run_id: type: string default: "" amdgpu_families: type: string amdgpu_targets: type: string default: "" test_runs_on: type: string sanity_check_only_for_family: type: boolean default: false test_type: type: string test_labels: type: string run_functional_tests: type: boolean default: false release_type: description: 'Release type: "" for CI, or "dev", "nightly", "prerelease".' type: string default: "" test_retry_count: type: number default: 2 #It will perform one additional try if failed required: false workflow_call: inputs: artifact_group: type: string artifact_run_id: type: string default: "" amdgpu_families: type: string amdgpu_targets: type: string default: "" test_runs_on: type: string sanity_check_only_for_family: type: boolean default: false test_type: type: string test_labels: type: string run_functional_tests: type: boolean default: false release_type: type: string default: "" test_retry_count: type: number default: 2 required: false push: branches: - ADHOCBUILD permissions: contents: read jobs: configure_test_matrix: name: "Configure test matrix (${{ inputs.amdgpu_families }})" # if there is a test machine available if: ${{ inputs.test_runs_on != '' }} runs-on: ${{ inputs.test_runs_on }} outputs: sanity_component: ${{ steps.configure.outputs.sanity_component }} components: ${{ steps.configure.outputs.components }} platform: ${{ steps.configure.outputs.platform }} shard_arr: ${{ steps.configure.outputs.shard_arr }} steps: - name: "Fetch 'build_tools' from repository" if: ${{ runner.os == 'Windows' }} uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: sparse-checkout: build_tools path: "prejob" # Checkout failure is possible on Windows, as it's the first job on a GPU test runner. # Post-job cleanup isn't necessary since no executables are launched in this job. - name: Pre-job cleanup processes on Windows if: ${{ runner.os == 'Windows' }} shell: powershell run: . '${{ github.workspace }}\prejob\build_tools\github_actions\cleanup_processes.ps1' - name: "Checking out repository" uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: repository: "ROCm/TheRock" ref: 'compiler/amd-staging' - name: Setting up Python uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: 3.12 - name: "Configuring CI options" id: configure env: ARTIFACT_GROUP: ${{ inputs.artifact_group }} AMDGPU_FAMILIES: ${{ inputs.amdgpu_families }} TEST_TYPE: ${{ inputs.test_type }} TEST_LABELS: ${{ inputs.test_labels }} # TODO(#3901): Consolidate run_functional_tests and benchmark_runs_on into a single run_extended_tests input. RUN_FUNCTIONAL_TESTS: ${{ inputs.run_functional_tests }} run: | if [[ "${TEST_TYPE:-}" == "quick" ]]; then PROJECTS_TO_TEST='rocroller,hipblas,hipblaslt,hipsolver,rocsolver,rocprim,hipcub,hipsparse,rocsparse,rocrand,hiprand,rocfft,hipfft,rocwmma' export PROJECTS_TO_TEST echo "PROJECTS_TO_TEST=$PROJECTS_TO_TEST" >> "$GITHUB_ENV" fi python ./build_tools/github_actions/fetch_test_configurations.py test_sanity_check: name: 'Test Sanity Check' needs: configure_test_matrix uses: './.github/workflows/test_component.yml' with: artifact_run_id: ${{ inputs.artifact_run_id }} artifact_group: ${{ inputs.artifact_group }} amdgpu_families: ${{ inputs.amdgpu_families }} amdgpu_targets: ${{ inputs.amdgpu_targets }} test_runs_on: ${{ inputs.test_runs_on }} platform: 'linux' component: ${{ needs.configure_test_matrix.outputs.sanity_component }} release_type: ${{ inputs.release_type }} aomp_smoke_test: name: 'AOMP smoke test' needs: test_sanity_check if: ${{ inputs.amdgpu_families == 'gfx94X-dcgpu' }} uses: './.github/workflows/test_aomp_smoke.yml' with: artifact_group: ${{ inputs.artifact_group }} artifact_run_id: ${{ inputs.artifact_run_id }} amdgpu_families: ${{ inputs.amdgpu_families }} test_runs_on: ${{ inputs.test_runs_on }} platform: 'linux' release_type: ${{ inputs.release_type }} test_components: name: 'Test ${{ matrix.components.job_name }}' needs: [test_sanity_check, configure_test_matrix] # skip tests if no test matrix to run and sanity check only requested if: ${{ needs.configure_test_matrix.outputs.components != '[]' && !inputs.sanity_check_only_for_family }} strategy: fail-fast: false matrix: components: ${{ fromJSON(needs.configure_test_matrix.outputs.components) }} uses: './.github/workflows/test_component.yml' with: artifact_run_id: ${{ inputs.artifact_run_id }} artifact_group: ${{ inputs.artifact_group }} amdgpu_families: ${{ inputs.amdgpu_families }} amdgpu_targets: ${{ inputs.amdgpu_targets }} test_retry_count: ${{ inputs.test_retry_count }} # If the test requires a multi GPU, use the multi GPU test runner # Otherwise, use the standard test runner test_runs_on: >- ${{ matrix.components.multi_gpu_runner != '' && matrix.components.multi_gpu_runner || inputs.test_runs_on }} platform: ${{ needs.configure_test_matrix.outputs.platform }} component: ${{ toJSON(matrix.components) }} release_type: ${{ inputs.release_type }}