Codecov and xCode Cloud

I have searched for similar issues before creating this topic.
I have verified that my repository is using the Codecov GitHub app, if using GitHub
I have validated my codecov.yaml configuration file.
I have filled out the below sections to the best of my ability.


Hello everyone.
Has anyone managed to set up xCode Cloud to upload coverage reports to Codecov successfully? I’ve managed to configure to upload reports, but for some reason they’re empty.

Codecov Output

Run command: 'source /Volumes/Task/ci_build.env && source /Volumes/Task/ci_plan.env && cd /Volumes/workspace/repository/<project-name>/ci_scripts && CI_XCODEBUILD_EXIT_CODE=0 /Volumes/workspace/repository/<project-name>/ci_scripts/'
/Volumes/workspace/repository/<project-name>/ci_scripts/ line 3: cd: /Volumes/workspace/repository/<project-name>/ci_scripts/resources: No such file or directory
[2022-08-08T10:10:41.553Z] ['verbose'] Start of uploader: 1659953441553...
[2022-08-08T10:10:41.555Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/
  Codecov report uploader 0.2.5
[2022-08-08T10:10:41.576Z] ['info'] => Project root located at: /Volumes/workspace/repository
[2022-08-08T10:10:41.579Z] ['info'] ->  Token found by arguments
[2022-08-08T10:10:41.580Z] ['verbose'] Start of network processing...
[2022-08-08T10:10:41.580Z] ['verbose'] Searching for files in /Volumes/workspace/repository
[2022-08-08T10:10:41.604Z] ['info'] Running xcode coversion...
[2022-08-08T10:10:42.672Z] ['verbose'] Writing coverage to ./coverage-report-resultbundle.json
[2022-08-08T10:10:42.681Z] ['verbose'] ./coverage-report-resultbundle.json
[2022-08-08T10:10:42.688Z] ['verbose'] coveragepy is not installed
[2022-08-08T10:10:42.688Z] ['info'] Searching for coverage files...
[2022-08-08T10:10:42.946Z] ['info'] Warning: Some files located via search were excluded from upload.
[2022-08-08T10:10:42.946Z] ['info'] If Codecov did not locate your files, please review
[2022-08-08T10:10:42.946Z] ['verbose'] Preparing to clean the following coverage paths: <project-name>/ci_scripts/coverage-report-resultbundle.json
[2022-08-08T10:10:42.946Z] ['info'] => Found 1 possible coverage files:
[2022-08-08T10:10:42.946Z] ['verbose'] End of network processing
[2022-08-08T10:10:42.947Z] ['info'] Processing /Volumes/workspace/repository/<project-name>/ci_scripts/coverage-report-resultbundle.json...
[2022-08-08T10:10:42.949Z] ['info'] Using manual override from args.
[2022-08-08T10:10:42.967Z] ['info'] Detected Local as the CI provider.
[2022-08-08T10:10:42.968Z] ['verbose'] -> Using the following env variables:
[2022-08-08T10:10:42.968Z] ['verbose']      BRANCH_NAME: undefined
[2022-08-08T10:10:42.968Z] ['verbose']      CI: TRUE
[2022-08-08T10:10:42.968Z] ['verbose']      GIT_BRANCH: undefined
[2022-08-08T10:10:42.968Z] ['verbose']      GIT_COMMIT: undefined
[2022-08-08T10:10:42.984Z] ['verbose'] Using the following upload parameters:
[2022-08-08T10:10:42.985Z] ['verbose'] branch
[2022-08-08T10:10:42.985Z] ['verbose'] build
[2022-08-08T10:10:42.985Z] ['verbose'] buildURL
[2022-08-08T10:10:42.985Z] ['verbose'] commit
[2022-08-08T10:10:42.985Z] ['verbose'] job
[2022-08-08T10:10:42.985Z] ['verbose'] pr
[2022-08-08T10:10:42.985Z] ['verbose'] service
[2022-08-08T10:10:42.985Z] ['verbose'] slug
[2022-08-08T10:10:42.985Z] ['verbose'] name
[2022-08-08T10:10:42.985Z] ['verbose'] tag
[2022-08-08T10:10:42.985Z] ['verbose'] flags
[2022-08-08T10:10:42.985Z] ['verbose'] parent
[2022-08-08T10:10:42.986Z] ['info'] Pinging Codecov:*******&branch=1490-codecov&build=389&build_url=&commit=<commit>&job=&pr=1493&service=&slug=<slug>&name=&tag=&flags=&parent=<parent>
[2022-08-08T10:10:42.987Z] ['verbose'] Passed token was 36 characters long
[2022-08-08T10:10:42.987Z] ['verbose']<commit>&job=&pr=1493&service=&slug=<slug>&name=&tag=&flags=&parent=<parent>
        Content-Type: 'text/plain'
        Content-Encoding: 'gzip'
        X-Reduced-Redundancy: 'false'
[2022-08-08T10:10:43.571Z] ['info']<ogr-name>/<repo>/commit/<commit>
[2022-08-08T10:10:43.571Z] ['verbose'] Returned upload url:
[2022-08-08T10:10:43.571Z] ['info'] Uploading...
[2022-08-08T10:10:43.832Z] ['info'] {"status":"success","resultURL":"<org-name>/<repo>/commit/<commit>"}
[2022-08-08T10:10:43.832Z] ['verbose'] End of uploader: 2279 milliseconds
Command executed successfully

Expected Results

Successfully uploaded report.

Actual Results

Screenshot 2022-08-15 at 16.58.37

Additional Information

Upload script:


 cd $CI_WORKSPACE/<repo>/ci_scripts/resources
 curl -Os
 chmod +x codecov


@dsk1306 can you share a commit SHA?

@tom I think it was df69939178f23f7f224739d6e587dddc926f6034

@dsk1306 got it, my guess is that you are passing in the wrong directory for xcodeArchivePath. From the docs, it says Specify the xcode archive path. Likely specified as the -resultBundlePath and should end in .xcresult

Unfortunately, I’m not an xcode developer so I’m a little bit out of my league here. Does that make sense? Else, can you share how you are collecting coverage?

@tom I use xCode Cloud provided $CI_RESULT_BUNDLE_PATH variable to specify the path to .xcresult. According to Apple docs, it should be ok, but I will double check it.

@dsk1306, no I think that probably is fine. Are you able to do a cat on that bundle to make sure it has data? I’m not sure if it’s compressed

@tom Ok, I’ve added cat $CI_RESULT_BUNDLE_PATH to my runscript and I’ve got

cat: /Volumes/workspace/resultbundle.xcresult: Is a directory

Do I need to perform extra compression here?

@tom Ok I’ve tried to preview the bundle with xccov view and it looks like xCode Cloud doesn’t collect coverage data because it failed

I’ve contacted Apple to see if I’m missing something.

@dsk1306 ahhhh I see. Is there anything I can do to help?

@tom I’ve created a ticket on the Apple Dev portal. Hopefully, they will give me an answer. Meanwhile, I will just use another CI. Thank you for your help!

1 Like