blob: 5e8637de44790175cc71528a356920807e625a7f [file] [log] [blame]
Dean Birch62c4f082020-01-17 16:13:26 +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
Dean Birchd0f9f8c2020-03-26 11:10:33 +00009@Library('trustedfirmware') _
10import org.trustedfirmware.Gerrit
Dean Birch62c4f082020-01-17 16:13:26 +000011
Xinyu Zhang4cdfd1b2021-05-21 15:10:49 +080012timestamps {
13 node("docker-amd64-tf-m-bionic") {
14 stage("Init") {
Dean Birch62c4f082020-01-17 16:13:26 +000015 cleanWs()
Xinyu Zhang4cdfd1b2021-05-21 15:10:49 +080016 dir("trusted-firmware-m") {
17 checkout(
18 poll: false,
19 scm: [
20 $class: 'GitSCM',
21 branches: [[name: '$GERRIT_BRANCH']],
22 extensions: [[$class: 'BuildChooserSetting', buildChooser: [$class: 'GerritTriggerBuildChooser']]],
23 userRemoteConfigs: [[
24 credentialsId: 'GIT_SSH_KEY',
25 refspec: '$GERRIT_REFSPEC', url: '$CODE_REPO'
26 ]]
27 ])
28 }
29 dir("tf-m-ci-scripts") {
30 checkout([$class: 'GitSCM', branches: [[name: '$CI_SCRIPTS_BRANCH']], userRemoteConfigs: [[credentialsId: 'GIT_SSH_KEY', url: '$CI_SCRIPTS_REPO']]])
31 }
32 }
33 stage("Check") {
34 def verify = 1
35 try {
36 sh """
37 cd trusted-firmware-m
38 ../tf-m-ci-scripts/run-checkpatch.sh -u
39 ../tf-m-ci-scripts/run-checkpatch.sh -r -l 1
40 """
41 } catch (Exception e) {
42 manager.buildFailure()
43 verify = -1
44 } finally {
45 g = new Gerrit()
46 g.verifyStatusInWorkspace(verify, 'checkpatch', 'static')
47 def buildStatus = (verify == 1) ? 'Successful' : 'Failed'
48 //g.commentInWorkspace("Build checkpatch ${buildStatus}: ${env.RUN_DISPLAY_URL}")
49 cleanWs()
50 }
Dean Birch62c4f082020-01-17 16:13:26 +000051 }
52 }
53}