Skip to content

Codecov: Swift coverage example

License

Notifications You must be signed in to change notification settings

codecov/example-swift

 
 

Repository files navigation

Codecov Swift Example

Build Status codecov.io

https://codecov.io @codecov hello@codecov.io

This repository serves as an example on how to use Codecov Global for Swift.

Usage

Enable "Gather coverage data" in your test scheme:

gather coverage data

Travis CI

Add to your .travis.yml file.

language: swift # or objective-c
osx_image: xcode7
script: ./test.sh
after_success:
  - bash <(curl -s https://codecov.io/bash)

Private Repos

Set CODECOV_TOKEN in your environment variables.

Add to your .travis.yml file.

env:
  global:
    - CODECOV_TOKEN=:uuid-repo-token

after_success:
  - bash <(curl -s https://codecov.io/bash)

Codecov

Make sure to specify Ignore files in the settings for your repo. You will find a textarea to add these settings in Codecov at https://codecov.io/gh/OWNER/REPO/features/ignore

Pods/.*
Applications/Xcode.app/.*
vendor/.*
Carthage/.*
build/.*
.*Tests.m
.*Tests.swift

# Add the folders containing your unit tests
# This ensures any test utility classes you create are also ignored
SwiftExampleTests/.*
SwiftExampleUITests/.*

View source and learn more about Codecov Global Uploader