From 588ffaea690c0098e966cc2975b05ecc97cd9736 Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Wed, 3 Apr 2024 17:44:30 +1100 Subject: [PATCH] Added a couple of file checks to avoid erroring when earlier steps failed --- .drone.jsonnet | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 47fcbbc87..bc5d11a75 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -145,7 +145,13 @@ local update_cocoapods_cache(depends_on) = { { name: 'Unit Test Summary', commands: [ - 'xcresultparser --output-format cli --failed-tests-only ./build/artifacts/testResults.xcresult', + ||| + if [[ -d ./build/artifacts/testResults.xcresult ]]; then + xcresultparser --output-format cli --failed-tests-only ./build/artifacts/testResults.xcresult + else + echo -e "\n\n\n\e[31;1mUnit test results not found\e[0m" + fi + |||, ], depends_on: ['Build and Run Tests'], when: { @@ -155,7 +161,11 @@ local update_cocoapods_cache(depends_on) = { { name: 'Delete Test Simulator', commands: [ - 'xcrun simctl delete $(cat ./build/artifacts/sim_uuid)' + ||| + if [[ -f ./build/artifacts/sim_uuid ]]; then + xcrun simctl delete $(cat ./build/artifacts/sim_uuid) + fi + |||, ], depends_on: [ 'Build and Run Tests',