At the time the tip is written, the Github repo is at https://github.com/SlatherOrg/slather, please modify the Gemfile accordingly if the repo name is updated
Install slather (run $ gem install bundler if you don't have bundle in your machine)
Test each command run in your machine before pushing code to your Github repo to ensure that there is no syntax error
MUST HAVE: run: bundle exec slather is used to push your code coverage to coveralls
Make sure you update -destination 'platform=iOS Simulator,OS=15.2,name=iPhone 13 Pro' as your desired Simulator
From CircleCI Project Settings >> Select Environment Variables >> Add new environment variable named COVERAGE_ACCESS_TOKEN with your coveralls project repository token.
With CircleCI and Coveralls are set, as soon as you push new commits or new pull requests, it will create new CI builds
On your CircleCI dashboard, you would be able to see your new build passed or failed
On your Coveralls dashboard, you would be able to see the test coverage of your project after each build
Environment
Enable code coverage for a Xcode project
Gather coverage data
in Xcode scheme’s Test action: Test >> Options >> Enable Code coverage >> Select all targetUse Slather to hook code coverage into CI
1. Setup Slather
Create a file named
Gemfile
in the root directory with the contentAt the time the tip is written, the Github repo is at https://github.com/SlatherOrg/slather, please modify the
Gemfile
accordingly if the repo name is updatedInstall slather (run
$ gem install bundler
if you don't have bundle in your machine)Generate code coverage
If you use a project in Xcode, RUN:
OR if you use a workspace in Xcode, RUN:
2. Configuration for CircleCI
Create a new
.slather.yml
in the root directory file with content:Create a new
.coveralls.yml
file in the root directory with content:Edit your
circle.yml
file:NOTES
Test each command
run
in your machine before pushing code to your Github repo to ensure that there is no syntax errorMUST HAVE:
run: bundle exec slather
is used to push your code coverage tocoveralls
Make sure you update
-destination 'platform=iOS Simulator,OS=15.2,name=iPhone 13 Pro'
as your desired SimulatorFrom CircleCI Project Settings >> Select Environment Variables >> Add new environment variable named
COVERAGE_ACCESS_TOKEN
with your coveralls project repository token.With CircleCI and Coveralls are set, as soon as you push new commits or new pull requests, it will create new CI builds
On your CircleCI dashboard, you would be able to see your new build passed or failed
On your Coveralls dashboard, you would be able to see the test coverage of your project after each build
That's all for this blog. Happy coding :]