Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
f645865
remove hardcoded makefiles and add workflow testing
sshi-amd Mar 2, 2026
70cfced
Disable MIVisionX OpenCV example
zichguan-amd Feb 3, 2026
4a471ca
Fix Makefile build step: correct GPU arch flag and add cancelled guard
claude Mar 6, 2026
36dc947
Use ROCM_PATH env variable for Makefile ROCm install directory
sshi-amd Mar 10, 2026
8992939
Merge branch 'ROCm:amd-staging' into makefile-testing-v2
sshi-amd Mar 11, 2026
d27b742
fix make command
sshi-amd Mar 17, 2026
4325882
Skip optional libraries in Makefile build when headers are missing
sshi-amd Mar 17, 2026
48b5c3b
Merge branch 'ROCm:amd-staging' into makefile-testing-v2
sshi-amd Mar 17, 2026
ca513dd
Move Makefile build step before CMake in CI workflow
sshi-amd Mar 17, 2026
c74de5c
Fix additional Makefile build failures: RPP and openmp_target
sshi-amd Mar 17, 2026
c66e072
Fix Makefile CI: target correct GPU arch and guard openmp_target
sshi-amd Mar 18, 2026
b1fdafc
Merge branch 'ROCm:amd-staging' into makefile-testing-v2
sshi-amd Mar 18, 2026
eb08d6d
Guard optional Makefile examples behind dependency checks
sshi-amd Mar 18, 2026
0dcca68
Fix Makefile CI: replace pkg-config checks with wildcard header checks
sshi-amd Mar 19, 2026
00f7862
Merge branch 'ROCm:amd-staging' into makefile-testing-v2
sshi-amd Mar 19, 2026
7ca427c
Fix Makefile CI: guard rocDecode behind FFmpeg check, fix pthread link
sshi-amd Mar 19, 2026
ef25293
Add configure phase and Makefile test runner to CI
sshi-amd Mar 19, 2026
b8f2454
Gate code_object_isa_decode behind libdw and amd_comgr checks
sshi-amd Mar 19, 2026
26d6e6d
Improve Makefile test runner output with progress counter
sshi-amd Mar 20, 2026
6c03dc7
Fix Makefile test runner: cd into example dir, add test args support
sshi-amd Mar 20, 2026
94ade5e
Run Makefile tests after ctest, using ctest test list as allow filter
sshi-amd Mar 20, 2026
88c30be
Skip rocdec_decode in Makefile tests (needs CMake test data)
sshi-amd Mar 20, 2026
df9d410
Fix FFmpeg/Vulkan detection: check libraries exist, not just headers
sshi-amd Mar 20, 2026
ca3bc40
Remove header-only fallback for FFmpeg/Vulkan detection
sshi-amd Mar 20, 2026
66e13e6
Fix rocdec_decode build on SLES: use config.mk for FFmpeg detection, …
sshi-amd Mar 20, 2026
3c54d77
Add link-test to configure.sh and require_deps.mk to catch missing -d…
sshi-amd Mar 20, 2026
3baedb6
Improve can_link compiler fallback chain (cc, gcc, clang, ROCm clang)
sshi-amd Mar 20, 2026
82eadf0
Use $(FFMPEG_LIBS) from config.mk instead of hardcoded -lavcodec/-lav…
sshi-amd Mar 20, 2026
1fac6e3
Use ctest JUnit XML results for Makefile test allow list
sshi-amd Mar 23, 2026
d258066
Skip rocprof-systems-basic (too slow) and rocprof-systems-advanced (f…
sshi-amd Mar 23, 2026
f75213c
Fix ctest JUnit XML path: use absolute GITHUB_WORKSPACE path
sshi-amd Mar 23, 2026
2084f9f
Match ctest output format in Makefile test runner
sshi-amd Mar 23, 2026
9638493
Skip hip_calling_global_functions on AlmaLinux 8 (glibc 2.28 too old)
sshi-amd Mar 23, 2026
5344913
Only run Makefile tests for tests that passed in ctest
sshi-amd Mar 23, 2026
df468d3
Use CMake build tree to selectively build Makefiles, remove configure.sh
sshi-amd Mar 23, 2026
85aee48
Fix find_cmake_built_dirs.py: match by executable name, not directory…
sshi-amd Mar 23, 2026
0d6332f
Update README: document Make build and test runner
sshi-amd Mar 23, 2026
427d1c5
Move test summary to end, add Makefile test log uploads
sshi-amd Mar 24, 2026
c6970af
Add Makefile build artifact upload
sshi-amd Mar 24, 2026
f841a5f
Fail workflow on Makefile build errors, pass HIP_ARCHITECTURES
sshi-amd Mar 24, 2026
d6e8a7f
Group build artifact uploads together after both builds complete
sshi-amd Mar 24, 2026
9460c6a
Remove ALWAYS_SKIP_TESTS entries for clean CI validation
sshi-amd Mar 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
97 changes: 97 additions & 0 deletions .github/build_tools/find_cmake_built_dirs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#!/usr/bin/env python3
"""Find source directories whose Makefile examples were also built by CMake.

Scans all Makefiles for 'EXAMPLE := <name>', then checks if that executable
exists anywhere in the CMake build tree. Outputs the list of source directories
whose Makefile targets have a matching CMake-built executable.

This lets us selectively build only Makefiles for examples whose dependencies
CMake confirmed are available, without requiring the directory structures to
match between source and build trees.
"""

import argparse
import os
import re
import stat


def find_makefile_examples(source_dir):
"""Walk source tree, find Makefiles with 'EXAMPLE := <name>'.

Returns dict mapping example_name -> relative source directory.
"""
examples = {}
for root, _dirs, files in os.walk(source_dir):
if "Makefile" not in files:
continue
makefile_path = os.path.join(root, "Makefile")
try:
with open(makefile_path) as f:
for line in f:
m = re.match(r"^EXAMPLE\s*:=\s*(\S+)", line)
if m:
name = m.group(1)
rel = os.path.relpath(root, source_dir)
examples[name] = rel
break
except OSError:
continue
return examples


def find_cmake_executables(build_dir):
"""Walk CMake build tree and collect names of executable files."""
executables = set()
for root, _dirs, files in os.walk(build_dir):
for fname in files:
fpath = os.path.join(root, fname)
try:
st = os.stat(fpath)
except OSError:
continue
if not (st.st_mode & stat.S_IXUSR):
continue
# Skip non-executable artifacts
if fname.endswith((".so", ".a", ".cmake", ".sh", ".py", ".txt")):
continue
if fname.startswith("lib"):
continue
executables.add(fname)
return executables


def main():
parser = argparse.ArgumentParser(
description="Find source dirs whose Makefile examples were built by CMake."
)
parser.add_argument("--build-dir", required=True, help="CMake build directory")
parser.add_argument("--source-dir", required=True, help="Source root directory")
parser.add_argument(
"--output", required=True, help="Output file (one directory per line)"
)
args = parser.parse_args()

build_dir = os.path.abspath(args.build_dir)
source_dir = os.path.abspath(args.source_dir)

makefile_examples = find_makefile_examples(source_dir)
cmake_executables = find_cmake_executables(build_dir)

matched_dirs = []
for name, rel_dir in sorted(makefile_examples.items()):
if name in cmake_executables:
matched_dirs.append(rel_dir)

with open(args.output, "w") as f:
for d in matched_dirs:
f.write(d + "\n")

print(
f"Found {len(matched_dirs)} Makefile directories matching CMake-built "
f"executables (out of {len(makefile_examples)} Makefiles total)"
)


if __name__ == "__main__":
main()
28 changes: 25 additions & 3 deletions .github/build_tools/generate_skip_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@
import argparse
import os

# Tests to always skip in Makefile runs. These require test data or arguments
# that are only set up by the CMake build system (e.g. ROCDECODE_TEST_FRAMES_DIR).
# ctest handles them via add_test() COMMAND args; the Makefile runner cannot.
MAKEFILE_SKIP_TESTS = [
"rocdecode_rocdec_decode",
]

# Tests to always skip (all targets, all distros).
ALWAYS_SKIP_TESTS = [
]

# Tests to skip per GPU target (one list per target that has skips)
SKIP_TESTS = {
"gfx1151": [
Expand All @@ -29,8 +40,6 @@
# Tests to skip for a specific GPU target + distro combination.
# Keys are "<gpu_target>:<distro_key>", e.g. "gfx1151:sles-15.7".
DISTRO_SKIP_TESTS = {
# Example:
# "gfx1151:sles-15.7": ["some_test"],
}


Expand All @@ -53,9 +62,22 @@ def main():
default="",
help="Distro key for distro-specific skips (e.g. sles-15.7)",
)
parser.add_argument(
"--makefile",
action="store_true",
help="Include Makefile-only skips (tests needing CMake test data)",
)
args = parser.parse_args()

lines = list(SKIP_TESTS.get(args.target, []))
lines = list(ALWAYS_SKIP_TESTS)
for test in SKIP_TESTS.get(args.target, []):
if test not in lines:
lines.append(test)

if args.makefile:
for test in MAKEFILE_SKIP_TESTS:
if test not in lines:
lines.append(test)

if args.distro:
combo_key = f"{args.target}:{args.distro}"
Expand Down
59 changes: 59 additions & 0 deletions .github/build_tools/parse_ctest_results.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/env python3
"""Parse ctest JUnit XML results and extract test names that actually ran.

Used by the Makefile test step to only run tests that ctest executed,
ensuring parity between CMake and Makefile test sets.
"""

import argparse
import sys
import xml.etree.ElementTree as ET


def main():
parser = argparse.ArgumentParser(
description="Extract test names from ctest JUnit XML results."
)
parser.add_argument(
"--junit", required=True, help="Path to ctest JUnit XML file"
)
parser.add_argument(
"--output", required=True, help="Output file (one test name per line)"
)
args = parser.parse_args()

try:
tree = ET.parse(args.junit)
except FileNotFoundError:
print(f"Warning: {args.junit} not found (ctest may not have run)")
print("Creating empty allow list — no Makefile tests will run")
with open(args.output, "w") as f:
pass
return
except ET.ParseError as e:
print(f"Error parsing {args.junit}: {e}", file=sys.stderr)
sys.exit(1)

root = tree.getroot()
passed = []
failed = []
for testcase in root.iter("testcase"):
name = testcase.get("name")
if not name:
continue
# In JUnit XML, failed tests have a <failure> child element
if testcase.find("failure") is not None:
failed.append(name)
else:
passed.append(name)

with open(args.output, "w") as f:
for name in passed:
f.write(name + "\n")

total = len(passed) + len(failed)
print(f"Extracted {len(passed)} passed tests from {total} ctest results ({len(failed)} failed, excluded)")


if __name__ == "__main__":
main()
Loading
Loading