Search code examples
iosswiftxcodeunit-testingxcode-cloud

How to enable and fail builds based on unit tests in Xcode Cloud CI/CD?


We are currently using Xcode Cloud for continuous integration and continuous deployment (CI/CD) for our iOS project. Our goal is to run unit tests in the cloud and ensure the build fails if any of these tests do not pass.

At the moment, Xcode Cloud seems to be ignoring the unit tests, and the build is marked as successful even when some tests fail. How can we configure Xcode Cloud to enable and consider unit tests when determining build success?


Solution

  • Required to Pass must be selected in the Xcode Cloud.

    Xcode Cloud -> Manage Workflows -> [One of your workflows] -> Actions -> Requirements -> Required to Pass.

    enter image description here