blob: 542a41ff778b8b44c6f936327a06d57231e9faa1 [file] [log] [blame]
Dean Bircha6ede7e2020-03-13 14:00:33 +00001//-------------------------------------------------------------------------------
2// Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
3//
4// SPDX-License-Identifier: BSD-3-Clause
5//
6//-------------------------------------------------------------------------------
7
Dean Birchd0f9f8c2020-03-26 11:10:33 +00008package org.trustedfirmware;
9
Dean Bircha6ede7e2020-03-13 14:00:33 +000010@NonCPS
11def getBuildCsv(results) {
12 def table = [:]
13 def projects = []
14 results.each { result ->
15 res = result.value[0]
16 config = result.value[1]
17 params = result.value[2]
18 if (params['BL2'] == 'True') {
19 bl2_string = 'BL2'
20 } else {
21 bl2_string = 'NOBL2'
22 }
Matthew Hartfb6fd362020-03-04 21:03:59 +000023 if (params["PSA_API_SUITE"].isEmpty()) {
24 psa_string = ""
25 } else {
26 psa_string = "_${params['PSA_API_SUITE']}"
27 }
28 row_string = "${params['TARGET_PLATFORM']}_${params['COMPILER']}_${params['CMAKE_BUILD_TYPE']}_${bl2_string}${psa_string}"
Dean Bircha6ede7e2020-03-13 14:00:33 +000029 column_string = "${params['PROJ_CONFIG']}"
30 row = table[row_string]
31 if (row == null) {
32 row = [:]
33 }
34 row[column_string] = res.getResult()
35 table[row_string] = row
36 if(!projects.contains(params['PROJ_CONFIG'])) {
37 projects += params['PROJ_CONFIG']
38 }
39 }
40 header = []
41 header += "" // top left
42 header.addAll(projects)
43 header.sort { it.toLowerCase() }
44 csvContent = []
45 for (row in table) {
46 row_item = []
47 row_item += row.key
48 for (project in projects) {
49 result = table[row.key][project]
50 if (result == null) {
51 result = "N/A"
52 }
53 row_item += result
54 }
55 csvContent.add(row_item)
56 }
57 csvContent.sort { it[0].toLowerCase() }
58 csvContent.add(0, header)
59 return csvContent
60}
61
62@NonCPS
63def getLinks(results) {
64 linksContent = []
65 results.each { result ->
66 res = result.value[0]
67 config = result.value[1]
68 url = res.getAbsoluteUrl()
Riku Voipiod78059f2020-09-10 13:35:13 +030069 linksContent.add("${config}: <a href=\"${url}\">Job</a>/<a href=\"${url}/consoleText\">Logs</a>/<a href=\"${url}/artifact/\">Artifacts</a><br/>")
Dean Bircha6ede7e2020-03-13 14:00:33 +000070 }
71 linksContent.sort()
72 return linksContent.join("\n")
73}