teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone
Blob Blame History Raw
From caf80cd558222a08687e8db95e3e1fcad0d69946 Mon Sep 17 00:00:00 2001
From: Jan Macku <jamacku@redhat.com>
Date: Mon, 30 May 2022 15:19:16 +0200
Subject: [PATCH] ci(Mergify): configuration update

Add rules for `needs-ci` label management

RHEL-only

Related: #2087652
---
 .mergify.yml | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)
 create mode 100644 .mergify.yml

diff --git a/.mergify.yml b/.mergify.yml
new file mode 100644
index 0000000000..c06e0fb1be
--- /dev/null
+++ b/.mergify.yml
@@ -0,0 +1,76 @@
+# doc: https://docs.mergify.com
+---
+
+pull_request_rules:
+  - name: Add `needs-ci` label on CI fail
+    conditions:
+      - or:
+        # Build test
+        - -check-success=build (gcc, 10, bfd)
+        - -check-success=build (gcc, 11, gold)
+        - -check-success=build (clang, 11, bfd)
+        - -check-success=build (clang, 12, gold)
+        - -check-success=build (clang, 13, lld)
+        # Unit tests
+        - -check-success=build (GCC, auto)
+        - -check-success=build (GCC_ASAN_UBSAN, auto)
+        - -check-success=build (CLANG, auto)
+        - -check-success=build (CLANG_ASAN_UBSAN, auto)
+        - -check-success=build (GCC, openssl)
+        - -check-success=build (CLANG, gcrypt)
+        # CentOS CI
+        - -check-success=CentOS CI (CentOS Stream 9)
+        - -check-success=CentOS CI (CentOS Stream 9 + sanitizers)
+        # LGTM
+        - and:
+          - "-check-success=LGTM analysis: JavaScript"
+          - "-check-neutral=LGTM analysis: JavaScript"
+        - and:
+          - "-check-success=LGTM analysis: Python"
+          - "-check-neutral=LGTM analysis: Python"
+        - and:    
+          - "-check-success=LGTM analysis: C/C++"
+          - "-check-neutral=LGTM analysis: Python"
+      # Packit
+      - -check-success=rpm-build:centos-stream-9-aarch64
+      - -check-success=rpm-build:centos-stream-9-x86_64
+    actions:
+      label:
+        add:
+          - needs-ci
+          
+  - name: Remove `needs-ci` label on CI success
+    conditions:
+      # Build test
+      - check-success=build (gcc, 10, bfd)
+      - check-success=build (gcc, 11, gold)
+      - check-success=build (clang, 11, bfd)
+      - check-success=build (clang, 12, gold)
+      - check-success=build (clang, 13, lld)
+      # Unit tests
+      - check-success=build (GCC, auto)
+      - check-success=build (GCC_ASAN_UBSAN, auto)
+      - check-success=build (CLANG, auto)
+      - check-success=build (CLANG_ASAN_UBSAN, auto)
+      - check-success=build (GCC, openssl)
+      - check-success=build (CLANG, gcrypt)
+      # CentOS CI
+      - check-success=CentOS CI (CentOS Stream 9)
+      - check-success=CentOS CI (CentOS Stream 9 + sanitizers)
+      # LGTM
+      - or:
+        - "check-success=LGTM analysis: JavaScript"
+        - "check-neutral=LGTM analysis: JavaScript"
+      - or:
+        - "check-success=LGTM analysis: Python"
+        - "check-neutral=LGTM analysis: Python"
+      - or:    
+        - "check-success=LGTM analysis: C/C++"
+        - "check-neutral=LGTM analysis: Python"
+      # Packit
+      - check-success=rpm-build:centos-stream-9-aarch64
+      - check-success=rpm-build:centos-stream-9-x86_64
+    actions:
+      label:
+        remove:
+          - needs-ci