Skip to content

Commit

Permalink
Don't run Windows and BSD jobs on crypto repo
Browse files Browse the repository at this point in the history
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
  • Loading branch information
bensze01 committed Sep 20, 2023
1 parent 31ec12b commit 20d0924
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 11 deletions.
2 changes: 1 addition & 1 deletion vars/checkout_repo.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Map<String, String> checkout_report_errors(scm_config) {

Map<String, String> checkout_repo() {
def scm_config
if (env.TARGET_REPO == 'tls' && env.CHECKOUT_METHOD == 'scm') {
if (env.TARGET_REPO != 'example' && env.CHECKOUT_METHOD == 'scm') {
scm_config = scm
} else {
scm_config = parametrized_repo(env.MBED_TLS_REPO, env.MBED_TLS_BRANCH)
Expand Down
20 changes: 12 additions & 8 deletions vars/environ.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,23 @@ def set_common_environment() {
env.MAKEFLAGS = '-j2'
}

def set_tls_pr_environment(is_production) {
void set_tls_pr_environment(boolean is_production, String repo='tls') {
set_common_environment()
env.JOB_TYPE = 'PR'
env.TARGET_REPO = 'tls'
env.TARGET_REPO = repo
if (is_production) {
set_common_pr_production_environment()
set_tls_pr_production_environment()
if (repo == 'tls') {
set_tls_pr_production_environment()
}
} else {
env.CHECKOUT_METHOD = 'parametrized'
}
}

def set_common_pr_production_environment() {
env.CHECKOUT_METHOD = 'scm'
if (env.BRANCH_NAME ==~ /PR-\d+-merge/) {
env.RUN_ABI_CHECK = 'true'
} else {
env.RUN_FREEBSD = 'true'
env.RUN_WINDOWS_TEST = 'true'
if (!(env.BRANCH_NAME ==~ /PR-\d+-merge/)) {
env.RUN_ALL_SH = 'true'
}
/* Extract owner and repository from the repo url - needed for testing Github merge queues
Expand All @@ -61,6 +59,12 @@ def set_common_pr_production_environment() {
}

def set_tls_pr_production_environment() {
if (env.BRANCH_NAME ==~ /PR-\d+-merge/) {
env.RUN_ABI_CHECK = 'true'
} else {
env.RUN_FREEBSD = 'true'
env.RUN_WINDOWS_TEST = 'true'
}
env.MBED_TLS_BRANCH = env.CHANGE_BRANCH
}

Expand Down
4 changes: 2 additions & 2 deletions vars/mbedtls.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def run_tls_tests(label_prefix='') {
}

/* main job */
def run_pr_job(is_production=true) {
void run_pr_job(boolean is_production=true, String repo='tls') {
analysis.main_record_timestamps('run_pr_job') {
try {
if (is_production) {
Expand Down Expand Up @@ -78,7 +78,7 @@ def run_pr_job(is_production=true) {
])
}

environ.set_tls_pr_environment(is_production)
environ.set_tls_pr_environment(is_production, repo)
common.maybe_notify_github('PENDING', 'In progress')

if (!common.is_open_ci_env && env.BRANCH_NAME ==~ /gh-readonly-queue\/.*/) {
Expand Down
22 changes: 22 additions & 0 deletions vars/psa_crypto.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2018-2023, Arm Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file is part of Mbed TLS (https://www.trustedfirmware.org/projects/mbed-tls/)
*/

void run_pr_job() {
mbedtls.run_pr_job(true, 'crypto')
}

0 comments on commit 20d0924

Please sign in to comment.