Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 1 | #!/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 Birch | d0f9f8c | 2020-03-26 11:10:33 +0000 | [diff] [blame] | 9 | @Library('trustedfirmware') _ |
| 10 | import org.trustedfirmware.Gerrit |
| 11 | |
Benjamin Copeland | be53b03 | 2020-10-30 19:57:59 +0000 | [diff] [blame] | 12 | def nodeLabel = "docker-amd64-tf-m-bionic" |
Dean Birch | d0f9f8c | 2020-03-26 11:10:33 +0000 | [diff] [blame] | 13 | if (env.COMPILER == "ARMCLANG") { |
Benjamin Copeland | be53b03 | 2020-10-30 19:57:59 +0000 | [diff] [blame] | 14 | nodeLabel = "docker-amd64-tf-m-bionic" |
Dean Birch | d0f9f8c | 2020-03-26 11:10:33 +0000 | [diff] [blame] | 15 | } |
| 16 | |
| 17 | node(nodeLabel) { |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 18 | stage("Init") { |
| 19 | cleanWs() |
| 20 | dir("trusted-firmware-m") { |
| 21 | checkout( |
| 22 | poll: false, |
| 23 | scm: [ |
| 24 | $class: 'GitSCM', |
| 25 | branches: [[name: '$GERRIT_BRANCH']], |
| 26 | extensions: [[$class: 'BuildChooserSetting', buildChooser: [$class: 'GerritTriggerBuildChooser']]], |
| 27 | userRemoteConfigs: [[ |
| 28 | credentialsId: 'GIT_SSH_KEY', |
| 29 | refspec: '$GERRIT_REFSPEC', url: '$CODE_REPO' |
| 30 | ]] |
| 31 | ]) |
| 32 | } |
| 33 | dir("tf-m-ci-scripts") { |
Colin Thorbinson | 58703db | 2020-11-24 12:02:19 +0000 | [diff] [blame] | 34 | checkout([$class: 'GitSCM', branches: [[name: '$CI_SCRIPTS_BRANCH']], userRemoteConfigs: [[credentialsId: 'GIT_SSH_KEY', url: '$CI_SCRIPTS_REPO']]]) |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 35 | } |
Karl Zhang | 02d3035 | 2020-08-20 13:48:52 +0800 | [diff] [blame] | 36 | dir("mbedtls") { |
| 37 | checkout( |
| 38 | changelog: false, |
| 39 | poll: false, |
| 40 | scm: [ |
| 41 | $class: 'GitSCM', |
| 42 | branches: [[name: 'FETCH_HEAD']], |
| 43 | userRemoteConfigs: [[ |
| 44 | refspec: 'refs/tags/$MBEDTLS_VERSION', |
| 45 | url: params.MBEDTLS_URL |
| 46 | ]] |
| 47 | ] |
| 48 | ) |
| 49 | } |
Tamas Ban | 260faf4 | 2020-06-08 16:14:55 +0100 | [diff] [blame] | 50 | dir("mcuboot") { |
| 51 | checkout( |
| 52 | changelog: false, |
| 53 | poll: false, |
| 54 | scm: [ |
| 55 | $class: 'GitSCM', |
| 56 | branches: [[name: 'FETCH_HEAD']], |
| 57 | userRemoteConfigs: [[ |
Tamas Ban | 1f1213e | 2020-09-25 12:38:31 +0100 | [diff] [blame] | 58 | refspec: '$MCUBOOT_REFSPEC', |
Tamas Ban | 260faf4 | 2020-06-08 16:14:55 +0100 | [diff] [blame] | 59 | url: params.MCUBOOT_URL |
| 60 | ]] |
| 61 | ] |
| 62 | ) |
| 63 | } |
Kevin Peng | b0bc0d1 | 2020-06-17 14:17:03 +0800 | [diff] [blame] | 64 | dir("tf-m-tests") { |
| 65 | checkout( |
| 66 | changelog: false, |
| 67 | poll: false, |
| 68 | scm: [ |
| 69 | $class: 'GitSCM', |
| 70 | branches: [[name: 'FETCH_HEAD']], |
| 71 | userRemoteConfigs: [[ |
| 72 | refspec: '$TFM_TESTS_REFSPEC', |
| 73 | url: params.TFM_TESTS_URL |
| 74 | ]] |
| 75 | ] |
| 76 | ) |
| 77 | } |
Dean Birch | d0f9f8c | 2020-03-26 11:10:33 +0000 | [diff] [blame] | 78 | if (env.PSA_API_SUITE != "") { |
| 79 | dir("psa-arch-tests") { |
| 80 | checkout( |
| 81 | changelog: false, |
| 82 | poll: false, |
| 83 | scm: [ |
| 84 | $class: 'GitSCM', |
| 85 | branches: [[name: 'FETCH_HEAD']], |
| 86 | userRemoteConfigs: [[ |
Karl Zhang | a6820f2 | 2020-06-17 11:34:06 +0800 | [diff] [blame] | 87 | refspec: '$PSA_ARCH_TESTS_VERSION', |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame] | 88 | url: params.PSA_ARCH_TESTS_URL |
Dean Birch | d0f9f8c | 2020-03-26 11:10:33 +0000 | [diff] [blame] | 89 | ]] |
| 90 | ] |
| 91 | ) |
| 92 | } |
| 93 | } |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 94 | } |
Dean Birch | d0f9f8c | 2020-03-26 11:10:33 +0000 | [diff] [blame] | 95 | try { |
| 96 | verify = 1 |
| 97 | stage("Build") { |
Riku Voipio | d78059f | 2020-09-10 13:35:13 +0300 | [diff] [blame] | 98 | sh "tf-m-ci-scripts/run-build.sh" |
Dean Birch | d0f9f8c | 2020-03-26 11:10:33 +0000 | [diff] [blame] | 99 | } |
| 100 | stage("Post") { |
Xinyu Zhang | 694eb49 | 2020-11-04 18:29:08 +0800 | [diff] [blame] | 101 | archiveArtifacts 'trusted-firmware-m/build/bin/**' |
Xinyu Zhang | 840a528 | 2020-12-30 15:28:56 +0800 | [diff] [blame^] | 102 | archiveArtifacts 'trusted-firmware-m/build/install/interface/**' |
Dean Birch | d0f9f8c | 2020-03-26 11:10:33 +0000 | [diff] [blame] | 103 | } |
| 104 | } catch (Exception e) { |
| 105 | manager.buildFailure() |
| 106 | verify = -1 |
| 107 | } finally { |
| 108 | g = new Gerrit() |
| 109 | g.verifyStatusInWorkspace(verify, env.CONFIG_NAME, 'build') |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame] | 110 | def buildStatus = (verify == 1) ? 'Successful' : 'Failed' |
| 111 | //g.commentInWorkspace("Build configuration ${env.CONFIG_NAME} ${buildStatus}: ${env.RUN_DISPLAY_URL}") |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 112 | cleanWs() |
| 113 | } |
| 114 | } |