Xcode cloud access source code after test execution

Hello,

I'm trying to upload my code coverage to an external service. I've created a workflow on Xcode Cloud that build and run my test + a ci_post_xcodebuild script that uploads my Project.xcresult to an external service

My problem here is that I need the repository source code the moment I upload my coverage file.

I have two steps in my workflow:

  1. Build tests (Which contain the sources but not the coverage results)
  2. Run tests (Which contain the coverage result but not the sources)

I found this in the Apple documentation:

Lastly, it should be noted that in a test action, multiple environments are used to build and run your tests. Only the environment that is used for building your tests will have your source code cloned into it by default. The environments that run your tests won't have source code cloned into them. They'll only have the ci_scripts folder made available on them. As a result, the post-clone script won't run in these environments and your custom scripts and any of their dependencies, such as other shell scripts and small tools, must be entirely contained within the ci_scripts folder.

Source: https://developer.apple.com/videos/play/wwdc2021/10269/

I feel a bit stuck here maybe Xcode cloud is not the way to go for this but I was wondering if by any way I could still check out my project sources after the test execution.

Replies

What would having your source code available in the test environment enable you to do? We'd appreciate hearing about your specific needs as an Enhancement Request filed through Feedback Assistant.

Hi @edford

After testing action we want to run static analysis for send to SonarQube. We had on the current CI system, this feature using fastlane. We want the coverage report, we run lizard and sent all this information to SonarQube to be sure we're passing the Quality Gates of our clients.

The issue is when we run fastlane and the folder not exist. The "new" worsksapce folder only had ci_scripts. I did it a ls -lrt on post_build sh.

Please, add this feature on Xcode Cloud, 'cuase all our iOS apps is pending to move on this way or keep on the current CI system (jenkins)

Thks and regards.

  • Please file your enhancement request using Feedback Assistant.

Add a Comment