From d6d71fecb952b35ad4e13354468595ddec728460 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Tue, 25 Apr 2023 15:28:35 -0400 Subject: [PATCH] wip: smokebuild Change-Id: I0c1d5cc5cf9a4f3e8287a081b5e832ebf5fd31eb --- jobs/babeltrace.yaml | 78 ++++++++++++++++++++++++++++++ scripts/babeltrace/check-format.sh | 19 ++++++++ 2 files changed, 97 insertions(+) create mode 100644 scripts/babeltrace/check-format.sh diff --git a/jobs/babeltrace.yaml b/jobs/babeltrace.yaml index 5d9e7d6..17821d6 100644 --- a/jobs/babeltrace.yaml +++ b/jobs/babeltrace.yaml @@ -380,6 +380,77 @@ - build-discarder: days-to-keep: 1 + publishers: + - workspace-cleanup: *babeltrace_publisher_workspace-cleanup_defaults + +- job-template: + name: 'dev_review_babeltrace_{version}_smokebuild' + defaults: babeltrace + concurrent: true + + scm: + - git: *babeltrace_scm_git_review + + triggers: + - gerrit: &babeltrace_trigger_gerrit_smoke + trigger-on: + - comment-added-event: + approval-category: 'Smoke-Build' + approval-value: 1 + projects: + - project-compare-type: 'PLAIN' + project-pattern: 'babeltrace' + branches: + - branch-compare-type: 'PLAIN' + branch-pattern: '{version}' + skip-vote: + successful: true + failed: true + unstable: true + notbuilt: true + aborted: true + + properties: + - inject: + properties-content: | + PROJECT_NAME=babeltrace + BABELTRACE_RUN_TESTS=no + - build-discarder: + days-to-keep: 1 + + <<: *babeltrace_matrix_axes_defaults + <<: *babeltrace_builders_defaults + + publishers: + - workspace-cleanup: *babeltrace_publisher_workspace-cleanup_defaults + +- job-template: + name: 'dev_review_babeltrace_{version}_check-format' + defaults: babeltrace + concurrent: true + + scm: + - git: *babeltrace_scm_git_review + + triggers: + - gerrit: *babeltrace_trigger_gerrit_smoke + + node: 'jammy-amd64' + + builders: + - shell: + !include-raw-escape: scripts/babeltrace/check-format.sh + + properties: + - inject: + properties-content: | + PROJECT_NAME=babeltrace + - build-discarder: + days-to-keep: 1 + + publishers: + - workspace-cleanup: *babeltrace_publisher_workspace-cleanup_defaults + - job-template: name: babeltrace_{version}_release defaults: babeltrace @@ -628,6 +699,13 @@ filter: '' touchstone: '' - 'dev_review_babeltrace_{version}_pylint' + - 'dev_review_babeltrace_{version}_smokebuild': + platforms: !!python/tuple [jammy-amd64] + builds: !!python/tuple [std] + confs: !!python/tuple [std] + filter: '' + touchstone: '' + - 'dev_review_babeltrace_{version}_check-format' - project: diff --git a/scripts/babeltrace/check-format.sh b/scripts/babeltrace/check-format.sh new file mode 100644 index 0000000..8eb5618 --- /dev/null +++ b/scripts/babeltrace/check-format.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# SPDX-FileCopyrightText: 2023 Michael Jeanson +# SPDX-License-Identifier: GPL-2.0-or-later + +set -exu + +cd src/babeltrace + +# Check if the topmost patch is properly formatted +git diff -U0 --no-color --relative HEAD^ | clang-format-diff-14 -p1 -i + +GIT_DIFF_OUTPUT=$(git diff) + +if [ -n "$GIT_DIFF_OUTPUT" ]; then + echo "$GIT_DIFF_OUTPUT" + exit 1 +fi + +# EOF -- 2.34.1