Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
284 changes: 284 additions & 0 deletions .github/workflows/multi_arch_ci_coverage_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,284 @@
# Copyright Advanced Micro Devices, Inc.
# SPDX-License-Identifier: MIT

# Multi-Arch CI Coverage - Linux
#
# Self-contained Linux coverage entry point. Computes the coverage matrix,
# builds one instrumented Linux stack for every coverage-enabled project, then
# fans out to multi_arch_ci_coverage_report.yml once per project.
#
# The rocm-libraries nightly invokes this via a cross-repo reusable `uses:` call.
# A future Windows mirror copies this file, swapping the build reusable and
# runners; multi_arch_ci_coverage_report.yml is reused unchanged.
#
# Currently targets gfx94X-dcgpu; change-based selection and multi-arch come later.

name: Multi-Arch CI Coverage - Linux

on:
workflow_dispatch:
inputs:
baseline_run_id:
type: string
description: "Regular nightly run id supplying the non-instrumented dependencies. Empty tests this run's own instrumented stack end to end."
default: ""
baseline_release_type:
type: string
description: "Release channel baseline_run_id published to; artifacts are bucketed by channel."
default: "nightly"
baseline_repository:
type: string
description: "Repository owning baseline_run_id (owner/repo). Release nightlies come from ROCm/rockrel; empty means this repository."
default: ""
projects_to_test:
type: string
description: "Comma-separated coverage projects (e.g. hiprand), case-insensitive. Aliases: rocm_libraries_all, all. Empty = every registered project."
default: ""
amdgpu_families:
type: string
description: "Comma-separated GPU families to collect coverage on."
default: "gfx94X-dcgpu"
coverage_config_source:
type: string
description: "Repository and ref holding the per-project coverage metadata."
default: "ROCm/rocm-libraries@main"
test_type:
type: string
description: "Test type to run against the instrumented build."
default: "standard"
quartz_tracking_id:
type: string
description: "Leave empty. Reserved for release tracking."
default: ""
repository:
type: string
description: "Repository holding this workflow's scripts. Empty defaults to github.repository; cross-repo callers pass ROCm/TheRock."
default: ""
ref:
type: string
description: "Ref/SHA of this workflow's scripts. Cross-repo callers pass the ref they pinned in uses:."
default: ""

# Required so cross-repo callers (rocm-libraries nightly) can invoke via `uses:`.
workflow_call:
inputs:
baseline_run_id:
type: string
description: "Regular nightly run id supplying the non-instrumented dependencies. Empty tests this run's own instrumented stack end to end."
default: ""
baseline_release_type:
type: string
description: "Release channel baseline_run_id published to; artifacts are bucketed by channel."
default: "nightly"
baseline_repository:
type: string
description: "Repository owning baseline_run_id (owner/repo). Release nightlies come from ROCm/rockrel; empty means this repository."
default: ""
projects_to_test:
type: string
description: "Comma-separated coverage projects (e.g. hiprand), case-insensitive. Aliases: rocm_libraries_all, all. Empty = every registered project."
default: ""
amdgpu_families:
type: string
description: "Comma-separated GPU families to collect coverage on."
default: "gfx94X-dcgpu"
coverage_config_source:
type: string
description: "Repository and ref holding the per-project coverage metadata."
default: "ROCm/rocm-libraries@main"
test_type:
type: string
description: "Test type to run against the instrumented build."
default: "standard"
quartz_tracking_id:
type: string
description: "Leave empty. Reserved for release tracking."
default: ""
repository:
type: string
description: "Repository holding this workflow's scripts. Empty defaults to github.repository; cross-repo callers pass ROCm/TheRock."
default: ""
ref:
type: string
description: "Ref/SHA of this workflow's scripts. Cross-repo callers pass the ref they pinned in uses:."
default: ""

permissions:
contents: read

run-name: >-
Multi-Arch CI Coverage - Linux
| baseline: ${{ inputs.baseline_run_id || 'none (self-contained)' }}
| ${{ inputs.amdgpu_families || 'gfx94X-dcgpu' }}

concurrency:
group: ${{ github.workflow }}-${{ github.run_id }}
cancel-in-progress: false

jobs:
setup_coverage_matrix:
name: Setup Coverage Matrix
runs-on: ubuntu-24.04
outputs:
coverage_matrix: ${{ steps.matrix.outputs.coverage_matrix }}
dist_amdgpu_families: ${{ steps.matrix.outputs.dist_amdgpu_families }}
families_matrix_json: ${{ steps.matrix.outputs.families_matrix_json }}
coverage_cmake_options: ${{ steps.matrix.outputs.coverage_cmake_options }}
needs_math_libs: ${{ steps.matrix.outputs.needs_math_libs }}
rocm_package_version: ${{ steps.rocm_package_version.outputs.rocm_package_version }}
steps:
- name: Checking out repository
id: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
timeout-minutes: 15
with:
# Cross-repo callers pass ROCm/TheRock + ref; same-repo defaults to github.repository.
repository: ${{ inputs.repository || github.repository }}
ref: ${{ inputs.ref }}

- name: Setting up Python
Comment on lines +130 to +139
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: 3.12

- name: Generate coverage matrix
id: matrix
env:
PROJECTS_TO_TEST: ${{ inputs.projects_to_test || '' }}
AMDGPU_FAMILIES: ${{ inputs.amdgpu_families || 'gfx94X-dcgpu' }}
COVERAGE_CONFIG_SOURCE: ${{ inputs.coverage_config_source || 'ROCm/rocm-libraries@main' }}
run: python ./build_tools/github_actions/configure_coverage_ci.py

- name: Compute package version
id: rocm_package_version
run: |
python ./build_tools/compute_rocm_package_version.py \
--release-type=ci \
--override-git-sha=${{ steps.checkout.outputs.commit }}

# Built first so later stages have a compiler-runtime to link against and
# fetch as an inbound artifact.
build_compiler_runtime:
name: Build Compiler Runtime
needs: setup_coverage_matrix
if: ${{ needs.setup_coverage_matrix.outputs.coverage_matrix != '[]' }}
uses: ./.github/workflows/multi_arch_build_portable_linux_artifacts.yml
secrets: inherit
with:
stage_name: compiler-runtime
stage_display_name: "Stage - Coverage Compiler Runtime"
timeout_minutes: 480 # 8 hours (compiler is big)
dist_amdgpu_families: ${{ needs.setup_coverage_matrix.outputs.dist_amdgpu_families }}
rocm_package_version: ${{ needs.setup_coverage_matrix.outputs.rocm_package_version }}
release_type: ci
quartz_tracking_id: ${{ inputs.quartz_tracking_id }}
# TheRock scripts for the instrumented build; cross-repo callers pass ROCm/TheRock + ref.
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
permissions:
contents: read
id-token: write

# Build the whole stage: test jobs need the full dependency set, and
# instrumenting as a unit keeps the per-project build cost flat.
# coverage_cmake_options is the THEROCK_COVERAGE_*_ALL group option for a whole
# group, else individual project flags; unselected projects build normally.
build_instrumented_math_libs:
name: Build Instrumented Math Libs
needs: [setup_coverage_matrix, build_compiler_runtime]
if: >-
${{
!failure() && !cancelled() &&
needs.setup_coverage_matrix.outputs.needs_math_libs == 'true'
}}
strategy:
fail-fast: false
matrix:
family_info: ${{ fromJSON(needs.setup_coverage_matrix.outputs.families_matrix_json) }}
uses: ./.github/workflows/multi_arch_build_portable_linux_artifacts.yml
secrets: inherit
with:
stage_name: math-libs
stage_display_name: "Stage - Coverage Math Libs (${{ matrix.family_info.amdgpu_family }})"
timeout_minutes: 480 # 8 hours; instrumented builds are slower than normal
amdgpu_family: ${{ matrix.family_info.amdgpu_family }}
dist_amdgpu_families: ${{ needs.setup_coverage_matrix.outputs.dist_amdgpu_families }}
extra_cmake_options: ${{ needs.setup_coverage_matrix.outputs.coverage_cmake_options }}
rocm_package_version: ${{ needs.setup_coverage_matrix.outputs.rocm_package_version }}
release_type: ci
quartz_tracking_id: ${{ inputs.quartz_tracking_id }}
# TheRock scripts for the instrumented build; cross-repo callers pass ROCm/TheRock + ref.
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
permissions:
contents: read
id-token: write

# One test + report job per project. Each installs baseline_run_id and replaces
# only its own project from this run's instrumented stack, so dependencies stay
# non-instrumented even though the build instrumented them all at once.
coverage_report:
name: Coverage::${{ matrix.coverage.project_name }} (${{ matrix.coverage.amdgpu_families }})
# Name compiler-runtime explicitly, not via math-libs: a selection with no
# math-libs build still tests against binaries that stage produced.
needs:
[
setup_coverage_matrix,
build_compiler_runtime,
build_instrumented_math_libs,
]
# Also guard the empty matrix: fromJSON('') would hard-error.
if: >-
${{
!failure() && !cancelled() &&
needs.setup_coverage_matrix.outputs.coverage_matrix != '[]'
}}
strategy:
fail-fast: false
matrix:
coverage: ${{ fromJSON(needs.setup_coverage_matrix.outputs.coverage_matrix) }}
uses: ./.github/workflows/multi_arch_ci_coverage_report.yml
secrets: inherit
with:
project_name: ${{ matrix.coverage.project_name }}
test_component: ${{ matrix.coverage.test_component }}
object_globs: ${{ matrix.coverage.object_globs }}
fetch_artifact_args: ${{ matrix.coverage.fetch_artifact_args }}
build_stage: ${{ matrix.coverage.build_stage }}
codecov_flag: ${{ matrix.coverage.codecov_flag }}
amdgpu_families: ${{ matrix.coverage.amdgpu_families }}
baseline_run_id: ${{ inputs.baseline_run_id }}
baseline_release_type: ${{ inputs.baseline_release_type }}
baseline_repository: ${{ inputs.baseline_repository }}
test_type: ${{ inputs.test_type || 'standard' }}
release_type: ci
# Forwarded to L2's checkouts and the component jobs.
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
permissions:
contents: read
id-token: write

ci_summary:
name: Coverage Summary
if: always()
needs:
- setup_coverage_matrix
- build_compiler_runtime
- build_instrumented_math_libs
- coverage_report
runs-on: ubuntu-24.04
steps:
- name: Checking out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
timeout-minutes: 15
with:
# Cross-repo callers pass ROCm/TheRock + ref; same-repo defaults to github.repository.
repository: ${{ inputs.repository || github.repository }}
ref: ${{ inputs.ref }}
- name: Evaluate workflow results
Comment on lines +272 to +279
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
python build_tools/github_actions/workflow_summary.py \
--needs-json '${{ toJSON(needs) }}'
Loading
Loading