From 689c3ce2475f373f886255b9ecf5f1fec55b0686 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 25 Sep 2023 13:58:18 +0200 Subject: [PATCH 1/3] [tryfix] setting return value for format_problems --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8e95420bea..de357cd0ff 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -909,7 +909,8 @@ clang-format-check: - run: git apply $PATCH_FILE_NAME\n - commit new changes" - - scripts/check-format.sh -af -p 8 || format_problems=$? + - scripts/check-format.sh -af -p 8 + - format_problems=$? - if [ $format_problems == 0 ] ; then exit 0; fi - mkdir tmp-formatting-fix -- GitLab From 72d4f651a890c0d589e9750238a414b2104b9884 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 26 Sep 2023 13:10:16 +0200 Subject: [PATCH 2/3] set default value for format_problems and only attempt artifact upload on failure --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index de357cd0ff..bbc2719ed0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -909,8 +909,8 @@ clang-format-check: - run: git apply $PATCH_FILE_NAME\n - commit new changes" - - scripts/check-format.sh -af -p 8 - - format_problems=$? + - format_problems=0 + - scripts/check-format.sh -af -p 8 || format_problems=$? - if [ $format_problems == 0 ] ; then exit 0; fi - mkdir tmp-formatting-fix @@ -927,7 +927,7 @@ clang-format-check: expire_in: 1 day paths: - tmp-formatting-fix/ - when: always + when: on_failure name: "$ARTIFACT_BASE_NAME" expose_as: "formatting patch" -- GitLab From 0a18f68a3342c25a633ead211f92fa24b9950bda Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 26 Sep 2023 13:13:06 +0200 Subject: [PATCH 3/3] fix whitespace --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bbc2719ed0..17a49753ff 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -910,7 +910,7 @@ clang-format-check: - commit new changes" - format_problems=0 - - scripts/check-format.sh -af -p 8 || format_problems=$? + - scripts/check-format.sh -af -p 8 || format_problems=$? - if [ $format_problems == 0 ] ; then exit 0; fi - mkdir tmp-formatting-fix -- GitLab