Module: Mesa
Branch: main
Commit: d971e3ba45059ba4e5f5e85d40a471dc66cf5df7
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d971e3ba45059ba4e5f5e85d40a471dc66cf5df7

Author: Eric Engestrom <[email protected]>
Date:   Mon Dec  4 21:45:33 2023 +0000

ci: fix rules for formatting checks

Fixes: 70eff587673ceec181ef ("ci: allow hw jobs even if lint jobs fail for 
non-Marge pipelines")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26511>

---

 .gitlab-ci/test-source-dep.yml | 18 ++++++++++++++++--
 .gitlab-ci/test/gitlab-ci.yml  |  5 -----
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/.gitlab-ci/test-source-dep.yml b/.gitlab-ci/test-source-dep.yml
index aa45e7031d1..f18beccba3a 100644
--- a/.gitlab-ci/test-source-dep.yml
+++ b/.gitlab-ci/test-source-dep.yml
@@ -225,15 +225,24 @@
    rules:
     - !reference [.never-post-merge-rules, rules]
     - !reference [.core-rules, rules]
-    - changes:
+    # in merge pipeline, formatting checks are not allowed to fail
+    - if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == 
"merge_request_event"
+      changes: &rust_file_list
       - src/**/*.rs
       when: on_success
+      allow_failure: false
+    # in other pipelines, formatting checks are allowed to fail
+    - changes: *rust_file_list
+      when: on_success
+      allow_failure: true
 
 .lint-clang-format-rules:
    rules:
     - !reference [.never-post-merge-rules, rules]
     - !reference [.core-rules, rules]
-    - changes:
+    # in merge pipeline, formatting checks are not allowed to fail
+    - if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == 
"merge_request_event"
+      changes: &clang_format_file_list
       - .clang-format
       - .clang-format-include
       - .clang-format-ignore
@@ -242,3 +251,8 @@
       - src/amd/vulkan/**/*
       - src/amd/compiler/**/*
       when: on_success
+      allow_failure: false
+    # in other pipelines, formatting checks are allowed to fail
+    - changes: *clang_format_file_list
+      when: on_success
+      allow_failure: true
diff --git a/.gitlab-ci/test/gitlab-ci.yml b/.gitlab-ci/test/gitlab-ci.yml
index b04dee912fe..abec3c5d0d8 100644
--- a/.gitlab-ci/test/gitlab-ci.yml
+++ b/.gitlab-ci/test/gitlab-ci.yml
@@ -25,11 +25,6 @@
   stage: lint
   extends:
     - .use-debian/x86_64_build
-  rules:
-    # in merge pipeline, don't touch the default settings
-    - if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_COMMIT_BRANCH == null
-    # in other pipelines, formatting checks are allowed to fail
-    - allow_failure: true
   variables:
     GIT_STRATEGY: fetch
   timeout: 10m

Reply via email to