Debian Codegraph @

.jenkins/common.groovy

raw
1 // This file is for internal AMD use.
2 // If you are interested in running your own Jenkins, please raise a github issue for assistance.
3
4 def runCompileCommand(platform, project, jobName, boolean debug=false, boolean sameOrg=true)
5 {
6 project.paths.construct_build_prefix()
7
8 String buildTypeArg = debug ? '-DCMAKE_BUILD_TYPE=Debug' : '-DCMAKE_BUILD_TYPE=Release'
9 String buildTypeDir = debug ? 'debug' : 'release'
10 String cmake = platform.jenkinsLabel.contains('centos') ? 'cmake3' : 'cmake'
11 //Set CI node's gfx arch as target if PR, otherwise use default targets of the library
12 String amdgpuTargets = env.BRANCH_NAME.startsWith('PR-') ? '-DAMDGPU_TARGETS=\$gfx_arch' : ''
13
14 def getRocPRIM = auxiliary.getLibrary('rocPRIM', platform.jenkinsLabel, null, sameOrg)
15
16 def command = """#!/usr/bin/env bash
17 set -x
18 ${getRocPRIM}
19 cd ${project.paths.project_build_prefix}
20 mkdir -p build/${buildTypeDir} && cd build/${buildTypeDir}
21 ${auxiliary.gfxTargetParser()}
22 ${cmake} --toolchain=toolchain-linux.cmake ${buildTypeArg} ${amdgpuTargets} -DBUILD_TEST=ON -DBUILD_BENCHMARK=ON ../..
23 make -j\$(nproc)
24 """
25
26 platform.runCommand(this, command)
27 }
28
29
30 def runTestCommand (platform, project)
31 {
32 String sudo = auxiliary.sudo(platform.jenkinsLabel)
33
34 def testCommand = "ctest --output-on-failure --verbose --timeout 900"
35 def command = """#!/usr/bin/env bash
36 set -x
37 cd ${project.paths.project_build_prefix}
38 cd ${project.testDirectory}
39 ${sudo} LD_LIBRARY_PATH=/opt/rocm/lib ${testCommand}
40 """
41
42 platform.runCommand(this, command)
43 }
44
45 def runPackageCommand(platform, project)
46 {
47 def packageHelper = platform.makePackage(platform.jenkinsLabel,"${project.paths.project_build_prefix}/build/release")
48
49 platform.runCommand(this, packageHelper[0])
50 platform.archiveArtifacts(this, packageHelper[1])
51 }
52
53 return this