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