{"id":20414538,"url":"https://github.com/codecov/example-swift","last_synced_at":"2025-08-08T15:37:39.930Z","repository":{"id":66039629,"uuid":"42443308","full_name":"codecov/example-swift","owner":"codecov","description":"Codecov: Swift coverage example","archived":false,"fork":false,"pushed_at":"2024-01-22T20:55:33.000Z","size":119,"stargazers_count":127,"open_issues_count":3,"forks_count":80,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-02T16:55:33.330Z","etag":null,"topics":["codecov","coverage","gather-coverage-data","swift","xcode8"],"latest_commit_sha":null,"homepage":"https://codecov.io","language":"Swift","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codecov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-14T10:54:57.000Z","updated_at":"2024-10-21T15:21:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"62df17c3-b641-4045-b363-c7ee89951737","html_url":"https://github.com/codecov/example-swift","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecov%2Fexample-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecov%2Fexample-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecov%2Fexample-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecov%2Fexample-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codecov","download_url":"https://codeload.github.com/codecov/example-swift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131472,"owners_count":21052854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codecov","coverage","gather-coverage-data","swift","xcode8"],"created_at":"2024-11-15T06:10:58.973Z","updated_at":"2025-04-10T00:19:14.847Z","avatar_url":"https://github.com/codecov.png","language":"Swift","readme":"[Codecov][1] Swift Example\n==========================\n\n[![Build Status](https://travis-ci.org/codecov/example-swift.svg)](https://travis-ci.org/codecov/example-swift) [![codecov.io](https://codecov.io/gh/codecov/example-swift/branch/master/graphs/badge.svg)](https://codecov.io/gh/codecov/example-swift/branch/master)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fexample-swift.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fexample-swift?ref=badge_shield)\n\n## Guide\n### Travis Setup\n\nAdd to your `.travis.yml` file.\n```yml\nlanguage: swift # or objective-c\nosx_image: xcode7\nscript:\n  - xcodebuild -scheme SwiftExample -workspace SwiftExample.xcworkspace -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6S,OS=9.1' build test\nafter_success:\n  - bash \u003c(curl -s https://codecov.io/bash)\n```\n### Produce Coverage Reports\nEnable \"Gather coverage data\" in your test scheme:\n![gather coverage data](docs/gather_coverage_data.png)\n\n### Bitrise CI\n\n1. Open dashboard.\n2. Click on workflow\n3. Add a workflow step\n4. Search for `Codecov`\n5. Paste the `Codecov Token`\n6. You are all set\n\n## Private Repos\n\u003e Set `CODECOV_TOKEN` in your environment variables.\n\n#### Strategies for producing coverage reports\n\n##### plist coverage `default`\nThis technique will upload the plist containing coverage data.\n- This format includes all files and projects. However, this can be very large causing issues processing.\n- Partial coverage data is included, which will look beautiful in Codecov UI.\n\nAgain, this is enabled by default.\n\n##### llvm-cov\nThis technique will run `llvm-cov` which produces coverage reports.\n- You can specify specific packages to run coverage against (see below)\n- No partial coverage data\n\nTo enable:\n\n```\nbash \u003c(curl -s https://codecov.io/bash) -X xcodellvm\n# - or -\nbash \u003c(curl -s https://codecov.io/bash) -J '^MyPackage$'\n# ^^ will enable xcodellvm and only process MyPackage coverage\n```\n\nYou may provide your Codecov token by either:\n\n- Setting `CODECOV_TOKEN` in your environment variables and adding the following to Travis:\n```yml\nafter_success:\n  - bash \u003c(curl -s https://codecov.io/bash)\n```\n- Providing the Codecov token directly to the invocation by adding the following to Travis:\n```yml\nafter_success:\n  - bash \u003c(curl -s https://codecov.io/bash) -t {YOUR-TOKEN-HERE}\n```\n\n## Speed up the build\nThe uploader has a *boil-the-ocean* approach, which can take a longer time to complete coverage report processing.\nWe suggest you add the following to only build reports for the project being tested:\n\n```sh\nbash \u003c(curl -s https://codecov.io/bash) -J 'SwiftExample'\n```\n\u003e Use your project name instead of `SwiftExample`. You can also provide multiple arguments via `-J 'ProjA' -J 'ProjB'`\n\n## Caveats\n### Private Repos\n\u003e Set `CODECOV_TOKEN` in your environment variables.\n\nAdd to your `.travis.yml` file.\n```yml\nafter_success:\n  - bash \u003c(curl -s https://codecov.io/bash) -t uuid-repo-token\n```\n\u003e Or you can set the environment variable `CODECOV_TOKEN` to your token.\n\n### Xcode8/Swift3 resulting in `0%` coverage.\n\n1. Update the test scheme with Xcode 8\n2. Do not use `xcpretty`. Seems broken with code coverage Xcode 8...\n\nExample project with Xcode8/Swift3: [yannickl/DynamicColor](https://github.com/yannickl/DynamicColor/blob/6ac768ba5c14941be5ebe169aca408655e185b20/.travis.yml)\n\n### Parsing Xcode 10 Coverage Reports\n\nOlder versions of Codecov (\u003c4.4) are not able to parse the coverage output directly from Xcode 10. As a workaround, you can feed the raw coverage information to a tool such as Slather, have it create a Cobertura XML style report, and upload that to Codecov. Detailed information on this workaround can be found (here)[https://github.com/SlatherOrg/slather#usage-with-codecov].\n\n## Support\n### Contact\n- Email: support@codecov.io\n- Slack: slack.codecov.io\n- [gh/codecov/support](https://github.com/codecov/support)\n\n1. More documentation at https://docs.codecov.io\n2. Configure codecov through the `codecov.yml`  https://docs.codecov.io/docs/codecov-yaml\n\n\nWe are happy to help if you have any questions. Please contact email our Support at [support@codecov.io](mailto:support@codecov.io)\n\n[1]: https://codecov.io/\n[4]: https://github.com/codecov/codecov-python\n\n\n## License\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fexample-swift.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fexample-swift?ref=badge_large)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodecov%2Fexample-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodecov%2Fexample-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodecov%2Fexample-swift/lists"}