From 433421a64d8318d776e317eaf712cf9b4785e29c Mon Sep 17 00:00:00 2001 From: amd-garydeng Date: Tue, 25 Feb 2025 13:59:28 -0700 Subject: [PATCH] add rocm-examples --- .jenkins/common.groovy | 28 +++++++++++++++++++++++++++- .jenkins/precheckin.groovy | 2 +- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.jenkins/common.groovy b/.jenkins/common.groovy index 79ebcb6f..ae8f7978 100644 --- a/.jenkins/common.groovy +++ b/.jenkins/common.groovy @@ -27,7 +27,7 @@ def runCompileCommand(platform, project, jobName, boolean debug=false, boolean s } -def runTestCommand (platform, project) +def runTestCommand (platform, project, boolean rocmExamples=false) { String sudo = auxiliary.sudo(platform.jenkinsLabel) @@ -40,6 +40,32 @@ def runTestCommand (platform, project) """ platform.runCommand(this, command) + if (rocmExamples){ + String buildString = "" + if (platform.os.contains("ubuntu")){ + buildString += "sudo dpkg -i *.deb" + } + else { + buildString += "sudo rpm -i *.rpm" + } + testCommand = """#!/usr/bin/env bash + set -ex + cd ${project.paths.project_build_prefix}/build/release/package + ${buildString} + cd ../../.. + testDirs=("Libraries/hipCUB") + git clone https://github.com/ROCm/rocm-examples.git + rocm_examples_dir=\$(readlink -f rocm-examples) + for testDir in \${testDirs[@]}; do + cd \${rocm_examples_dir}/\${testDir} + cmake -S . -B build + cmake --build build + cd ./build + ctest --output-on-failure + done + """ + platform.runCommand(this, testCommand, "ROCM Examples") + } } def runPackageCommand(platform, project) diff --git a/.jenkins/precheckin.groovy b/.jenkins/precheckin.groovy index 074bc536..70f2bb54 100644 --- a/.jenkins/precheckin.groovy +++ b/.jenkins/precheckin.groovy @@ -34,7 +34,7 @@ def runCI = { platform, project-> - commonGroovy.runTestCommand(platform, project) + commonGroovy.runTestCommand(platform, project, true) } def packageCommand =