Giter Club home page Giter Club logo

example-swift's Introduction

Codecov Swift Example

Build Status codecov.io FOSSA Status

Guide

Travis Setup

Add to your .travis.yml file.

language: swift # or objective-c
osx_image: xcode7
script:
  - xcodebuild -scheme SwiftExample -workspace SwiftExample.xcworkspace -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6S,OS=9.1' build test
after_success:
  - bash <(curl -s https://codecov.io/bash)

Produce Coverage Reports

Enable "Gather coverage data" in your test scheme: gather coverage data

Bitrise CI

  1. Open dashboard.
  2. Click on workflow
  3. Add a workflow step
  4. Search for Codecov
  5. Paste the Codecov Token
  6. You are all set

Private Repos

Set CODECOV_TOKEN in your environment variables.

Strategies for producing coverage reports

plist coverage default

This technique will upload the plist containing coverage data.

  • This format includes all files and projects. However, this can be very large causing issues processing.
  • Partial coverage data is included, which will look beautiful in Codecov UI.

Again, this is enabled by default.

llvm-cov

This technique will run llvm-cov which produces coverage reports.

  • You can specify specific packages to run coverage against (see below)
  • No partial coverage data

To enable:

bash <(curl -s https://codecov.io/bash) -X xcodellvm
# - or -
bash <(curl -s https://codecov.io/bash) -J '^MyPackage$'
# ^^ will enable xcodellvm and only process MyPackage coverage

You may provide your Codecov token by either:

  • Setting CODECOV_TOKEN in your environment variables and adding the following to Travis:
after_success:
  - bash <(curl -s https://codecov.io/bash)
  • Providing the Codecov token directly to the invocation by adding the following to Travis:
after_success:
  - bash <(curl -s https://codecov.io/bash) -t {YOUR-TOKEN-HERE}

Speed up the build

The uploader has a boil-the-ocean approach, which can take a longer time to complete coverage report processing. We suggest you add the following to only build reports for the project being tested:

bash <(curl -s https://codecov.io/bash) -J 'SwiftExample'

Use your project name instead of SwiftExample. You can also provide multiple arguments via -J 'ProjA' -J 'ProjB'

Caveats

Private Repos

Set CODECOV_TOKEN in your environment variables.

Add to your .travis.yml file.

after_success:
  - bash <(curl -s https://codecov.io/bash) -t uuid-repo-token

Or you can set the environment variable CODECOV_TOKEN to your token.

Xcode8/Swift3 resulting in 0% coverage.

  1. Update the test scheme with Xcode 8
  2. Do not use xcpretty. Seems broken with code coverage Xcode 8...

Example project with Xcode8/Swift3: yannickl/DynamicColor

Parsing Xcode 10 Coverage Reports

Older versions of Codecov (<4.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].

Support

Contact

  1. More documentation at https://docs.codecov.io
  2. Configure codecov through the codecov.yml https://docs.codecov.io/docs/codecov-yaml

We are happy to help if you have any questions. Please contact email our Support at [email protected]

License

FOSSA Status

example-swift's People

Contributors

amadeu01 avatar bgerstle avatar codecov-test avatar eliatcodecov avatar fossabot avatar freak4pc avatar jarbogast avatar stevepeak avatar thomasrockhu avatar thomasrockhu-codecov avatar tomped avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.