@@ -734,7 +734,10 @@ jobs:
734734 # always(): the test step exits non-zero on a failing shard, which would otherwise
735735 # SKIP this step — i.e. we'd capture screenshots/logs/videos for green shards but NOT
736736 # for the failing ones we actually need to debug. Run regardless of test outcome.
737- if : ${{ always() }}
737+ # !cancelled() rather than always(): always() is exempt from cancellation, so a
738+ # cancelled run still uploaded five artifact sets per shard before it would die.
739+ # This still covers pass AND fail (the cases whose artifacts we want).
740+ if : ${{ !cancelled() }}
738741 uses : ./.github/actions/archive-test-results
739742 with :
740743 platform : android
@@ -803,8 +806,10 @@ jobs:
803806 bash maestro/run_maestro_widget_tests.sh ios "${{ matrix.widget }}" || [ "$UPDATE_BASELINES" = "true" ]
804807
805808 - name : Archive test results
806- # always(): capture failure artifacts (the failing shard's test step exits non-zero).
807- if : ${{ always() }}
809+ # !cancelled(): capture failure artifacts (the failing shard's test step exits
810+ # non-zero), but do NOT hold a cancelled run open uploading artifacts nobody wants
811+ # -- always() is exempt from cancellation, !cancelled() is not.
812+ if : ${{ !cancelled() }}
808813 uses : ./.github/actions/archive-test-results
809814 with :
810815 platform : ios
@@ -883,8 +888,10 @@ jobs:
883888 bash maestro/run_maestro_jsactions_tests.sh android || [ "$UPDATE_BASELINES" = "true" ]
884889
885890 - name : Archive test results
886- # always(): capture failure artifacts (the failing shard's test step exits non-zero).
887- if : ${{ always() }}
891+ # !cancelled(): capture failure artifacts (the failing shard's test step exits
892+ # non-zero), but do NOT hold a cancelled run open uploading artifacts nobody wants
893+ # -- always() is exempt from cancellation, !cancelled() is not.
894+ if : ${{ !cancelled() }}
888895 uses : ./.github/actions/archive-test-results
889896 with :
890897 platform : android
@@ -941,8 +948,10 @@ jobs:
941948 bash maestro/run_maestro_jsactions_tests.sh ios || [ "$UPDATE_BASELINES" = "true" ]
942949
943950 - name : Archive test results
944- # always(): capture failure artifacts (the failing shard's test step exits non-zero).
945- if : ${{ always() }}
951+ # !cancelled(): capture failure artifacts (the failing shard's test step exits
952+ # non-zero), but do NOT hold a cancelled run open uploading artifacts nobody wants
953+ # -- always() is exempt from cancellation, !cancelled() is not.
954+ if : ${{ !cancelled() }}
946955 uses : ./.github/actions/archive-test-results
947956 with :
948957 platform : ios
0 commit comments