From bf55c9f591d8c3c533124c4ff3651f7913e49d4b Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Mon, 4 Dec 2023 21:45:33 +0000 Subject: [PATCH] ci: fix rules for formatting checks Fixes: 70eff587673ceec181ef ("ci: allow hw jobs even if lint jobs fail for non-Marge pipelines") Part-of: (cherry picked from commit d971e3ba45059ba4e5f5e85d40a471dc66cf5df7) --- .gitlab-ci/test-source-dep.yml | 18 ++++++++++++++++-- .gitlab-ci/test/gitlab-ci.yml | 5 ----- .pick_status.json | 2 +- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci/test-source-dep.yml b/.gitlab-ci/test-source-dep.yml index 4320fd8..ba4d238 100644 --- a/.gitlab-ci/test-source-dep.yml +++ b/.gitlab-ci/test-source-dep.yml @@ -222,14 +222,23 @@ .lint-rustfmt-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 [.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 @@ -240,3 +249,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 7abdf8b..45ca535 100644 --- a/.gitlab-ci/test/gitlab-ci.yml +++ b/.gitlab-ci/test/gitlab-ci.yml @@ -23,11 +23,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 diff --git a/.pick_status.json b/.pick_status.json index f4af8d3..043bdb1 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1184,7 +1184,7 @@ "description": "ci: fix rules for formatting checks", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "70eff587673ceec181efda86d2e93ede44a59532", "notes": null -- 2.7.4