wip: smokebuild
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 25 Apr 2023 19:28:35 +0000 (15:28 -0400)
committerMichael Jeanson <mjeanson@efficios.com>
Tue, 25 Apr 2023 19:28:35 +0000 (15:28 -0400)
Change-Id: I0c1d5cc5cf9a4f3e8287a081b5e832ebf5fd31eb

jobs/babeltrace.yaml
scripts/babeltrace/check-format.sh [new file with mode: 0644]

index 5d9e7d6e3ba62e6726dab6e4ab889ac69d8b3eaf..17821d69e035770098e731993b2e3cbd68f15343 100644 (file)
       - 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
           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 (file)
index 0000000..8eb5618
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+# SPDX-FileCopyrightText: 2023 Michael Jeanson <mjeanson@efficios.com>
+# 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
This page took 0.024844 seconds and 4 git commands to generate.