blob: ecc3507685df43252f16e47f809ba538a20c18fb [file] [log] [blame]
Dean Birch62c4f082020-01-17 16:13:26 +00001#!/usr/bin/env groovy
2//-------------------------------------------------------------------------------
Paul Sokolovskye1ad4772024-03-07 00:08:27 +07003// Copyright (c) 2020-2024, Arm Limited and Contributors. All rights reserved.
Dean Birch62c4f082020-01-17 16:13:26 +00004//
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 {
Paul Sokolovskye1ad4772024-03-07 00:08:27 +070013 node("docker-amd64-tf-m-jammy") {
Leonardo Sandoval7090b2c2021-09-17 13:20:44 -050014 // Clone TF-M repositories so share folder can be reused by downstream jobs
Xinyu Zhang4cdfd1b2021-05-21 15:10:49 +080015 stage("Init") {
Dean Birch62c4f082020-01-17 16:13:26 +000016 cleanWs()
Xinyu Zhang4cdfd1b2021-05-21 15:10:49 +080017 dir("tf-m-ci-scripts") {
18 checkout([$class: 'GitSCM', branches: [[name: '$CI_SCRIPTS_BRANCH']], userRemoteConfigs: [[credentialsId: 'GIT_SSH_KEY', url: '$CI_SCRIPTS_REPO']]])
Leonardo Sandoval7090b2c2021-09-17 13:20:44 -050019 sh "./clone.sh"
Xinyu Zhang4cdfd1b2021-05-21 15:10:49 +080020 }
21 }
22 stage("Check") {
23 def verify = 1
24 try {
25 sh """
26 cd trusted-firmware-m
27 ../tf-m-ci-scripts/run-checkpatch.sh -u
28 ../tf-m-ci-scripts/run-checkpatch.sh -r -l 1
29 """
30 } catch (Exception e) {
31 manager.buildFailure()
32 verify = -1
33 } finally {
34 g = new Gerrit()
35 g.verifyStatusInWorkspace(verify, 'checkpatch', 'static')
36 def buildStatus = (verify == 1) ? 'Successful' : 'Failed'
37 //g.commentInWorkspace("Build checkpatch ${buildStatus}: ${env.RUN_DISPLAY_URL}")
38 cleanWs()
39 }
Dean Birch62c4f082020-01-17 16:13:26 +000040 }
41 }
42}