name: TheRock CI on: push: branches: - develop - release/therock-* pull_request: types: - opened - synchronize - reopened - labeled - unlabeled workflow_dispatch: inputs: projects: type: string description: "Insert space-separated list of projects to test or 'all' to test all projects. ex: 'projects/rocprim projects/hipcub'" linux_amdgpu_families: type: string description: "Insert comma-separated list of Linux GPU families to build and test. ex: gfx94X, gfx1151" default: "" windows_amdgpu_families: type: string description: "Insert comma-separated list of Windows GPU families to build and test. ex: gfx94X, gfx1151" default: "" workflow_call: permissions: contents: read concurrency: # A PR number if a pull request and otherwise the commit hash. This cancels # queued and in-progress runs for the same PR (presubmit) or commit # (postsubmit). The workflow name is prepended to avoid conflicts between # different workflows. group: ${{ github.workflow }}-${{ github.event.number || github.sha }} cancel-in-progress: true jobs: setup: name: "Setup" runs-on: ubuntu-24.04 outputs: therock_ref: ${{ steps.ci-env.outputs.therock-ref }} docker_image: ${{ steps.ci-env.outputs.docker-image }} rocm_package_version: ${{ steps.rocm_package_version.outputs.rocm_package_version }} linux_projects: ${{ steps.linux_projects.outputs.linux_projects }} linux_build_runs_on: ${{ steps.linux_projects.outputs.build_runs_on }} windows_projects: ${{ steps.windows_projects.outputs.windows_projects }} windows_build_runs_on: ${{ steps.windows_projects.outputs.build_runs_on }} test_type: ${{ steps.linux_projects.outputs.test_type }} linux_package_targets: ${{ steps.configure_linux.outputs.package_targets }} windows_package_targets: ${{ steps.configure_windows.outputs.package_targets }} steps: - name: Checkout code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: sparse-checkout: .github sparse-checkout-cone-mode: true fetch-depth: 2 # Loads shared CI constants (TheRock ref, Docker image, runner labels) # from the ci-env composite action so they are defined in one place. - name: Load CI environment id: ci-env uses: ./.github/actions/ci-env - name: Checkout TheRock repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: repository: "ROCm/TheRock" path: TheRock ref: ${{ steps.ci-env.outputs.therock-ref }} - name: Checkout CI config uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: repository: ROCm/therock-ci-config ref: main path: ci-config continue-on-error: true - name: Set up Python uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: "3.12" - name: Install python dependencies run: | python -m pip install --upgrade pip pip install pydantic requests - name: Compute package version id: rocm_package_version run: | python TheRock/build_tools/compute_rocm_package_version.py --release-type=dev - name: Set PR_LABELS variable with labels assigned to pull request if: ${{ github.event.pull_request }} # only set PR labels var if this is a pull request env: GITHUB_TOKEN: ${{ github.token }} PR_NUMBER: ${{ github.event.number }} run: | echo "PR_LABELS=$(gh pr view ${PR_NUMBER} --json labels)" >> $GITHUB_ENV - name: Determine Linux projects to run id: linux_projects env: PROJECTS: ${{ inputs.projects }} PLATFORM: "linux" CI_CONFIG_PATH: ci-config run: | python .github/scripts/therock_configure_ci.py - name: Determine Windows projects to run id: windows_projects env: PROJECTS: ${{ inputs.projects }} PLATFORM: "windows" CI_CONFIG_PATH: ci-config run: | python .github/scripts/therock_configure_ci.py - name: Fetch Linux targets for build and test env: THEROCK_PACKAGE_PLATFORM: "linux" AMDGPU_FAMILIES: ${{ inputs.linux_amdgpu_families || 'gfx94X, gfx950' }} CI_CONFIG_PATH: ci-config id: configure_linux run: python ./TheRock/build_tools/github_actions/fetch_package_targets.py - name: Fetch Windows targets for build and test env: THEROCK_PACKAGE_PLATFORM: "windows" AMDGPU_FAMILIES: ${{ inputs.windows_amdgpu_families || 'gfx1151' }} CI_CONFIG_PATH: ci-config id: configure_windows run: python ./TheRock/build_tools/github_actions/fetch_package_targets.py therock-ci-linux: name: Linux (${{ matrix.projects.projects_to_test }} | ${{ matrix.target_bundle.amdgpu_family }}) permissions: contents: read id-token: write needs: setup if: ${{ needs.setup.outputs.linux_projects != '[]' }} strategy: fail-fast: false matrix: projects: ${{ fromJSON(needs.setup.outputs.linux_projects) }} target_bundle: ${{ fromJSON(needs.setup.outputs.linux_package_targets) }} uses: ./.github/workflows/therock-ci-linux.yml secrets: inherit with: therock_ref: ${{ needs.setup.outputs.therock_ref }} docker_image: ${{ needs.setup.outputs.docker_image }} rocm_package_version: ${{ needs.setup.outputs.rocm_package_version }} cmake_options: ${{ matrix.projects.cmake_options }} projects_to_test: ${{ matrix.projects.projects_to_test }} test_type: ${{ needs.setup.outputs.test_type }} amdgpu_families: ${{ matrix.target_bundle.amdgpu_family }} test_runs_on: ${{ matrix.target_bundle.test_machine }} build_runs_on: ${{ needs.setup.outputs.linux_build_runs_on }} therock-ci-windows: name: Windows (${{ matrix.projects.projects_to_test }} | ${{ matrix.target_bundle.amdgpu_family }}) permissions: contents: read id-token: write needs: setup if: ${{ needs.setup.outputs.windows_projects != '[]' }} strategy: fail-fast: false matrix: projects: ${{ fromJSON(needs.setup.outputs.windows_projects) }} target_bundle: ${{ fromJSON(needs.setup.outputs.windows_package_targets) }} uses: ./.github/workflows/therock-ci-windows.yml secrets: inherit with: therock_ref: ${{ needs.setup.outputs.therock_ref }} rocm_package_version: ${{ needs.setup.outputs.rocm_package_version }} cmake_options: ${{ matrix.projects.cmake_options }} projects_to_test: ${{ matrix.projects.projects_to_test }} test_type: ${{ needs.setup.outputs.test_type }} amdgpu_families: ${{ matrix.target_bundle.amdgpu_family }} test_runs_on: ${{ matrix.target_bundle.test_machine }} build_runs_on: ${{ needs.setup.outputs.windows_build_runs_on }} therock_ci_summary: name: TheRock CI Summary if: always() needs: - setup - therock-ci-linux - therock-ci-windows runs-on: ubuntu-24.04 steps: - name: Output failed jobs run: | echo '${{ toJson(needs) }}' FAILED_JOBS="$(echo '${{ toJson(needs) }}' \ | jq --raw-output \ 'map_values(select(.result!="success" and .result!="skipped")) | keys | join(",")' \ )" if [[ "${FAILED_JOBS}" != "" ]]; then echo "The following jobs failed: ${FAILED_JOBS}" exit 1 fi