From 6512589395f76fe0ebefeef2662d5d883d09de83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Ackerman?= <6054733+akrmn@users.noreply.github.com> Date: Mon, 14 Nov 2022 16:06:34 +0100 Subject: [PATCH] Use conditional job to determine collect_build_data result (#15547) --- ci/build.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/ci/build.yml b/ci/build.yml index 4077c45fbf..655e3f686b 100644 --- a/ci/build.yml +++ b/ci/build.yml @@ -362,8 +362,8 @@ jobs: - bash: ci/check-protobuf-stability.sh - template: tell-slack-failed.yml -- job: collect_build_data - condition: always() +- job: collect_build_data_failed + condition: failed() dependsOn: - Linux - Linux_oracle @@ -374,6 +374,16 @@ jobs: - compatibility_linux - compatibility_stable_protobuf - check_for_release - pool: - name: "ubuntu_20_04" - demands: assignment -equals default + +- job: collect_build_data + condition: always() + dependsOn: + - collect_build_data_failed + variables: + failed_result: $[ dependencies.collect_build_data_failed.result ] + steps: + - bash: "exit 1" + # Since 'collect_build_data_failed' only runs when 'failed()', if it was + # successful that means at least one of its dependencies failed, so we set + # the result of 'collect_build_data' to 'Failed' with 'exit 1' + condition: eq(variables.failed_result, 'Succeeded')