Skip to content

jinkh93/codecoveragetools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codecoveragetools

A sample project containing code to run code coverage tools in github actions for iOS projects. This project attempts to simplify and explain the steps required to integrate the following code coverage tools in github actions:

Note that your XCode project will also have to be signed by setting a team as well.

CodeClimate

CodeClimate does not provide an app or integration with github directly. You will need to download their uploader in order to integrate to codeclimate.

CodeClimate can injest a coverage file generated by xccov. This project converts the output .xcresult file to a .json file using xccov which is injested by the codeclimate uploader.

CodeCov

For iOS projects, CodeCov requires the upload file to be in a cobertura xml format. This project generates the xml file in the fastlane script using slather.

Coveralls

This project produces a lcov format to upload to coveralls. The process of generating the lcov file is as follows:

  1. fastlane test generates a .xcresult file
  2. .xcresult file converted to a .json file using xccov view command
  3. .json file converted to lcov.info file using xccov2lcov
  4. lcov.info file ready to upload to coveralls

Coveralls provides a github actions app for the actual uploading step.

Personal Review Comments

CodeClimate was the easiest to integrate because it required no other dependencies (such as slather or xccov2lcov), but also it was the worst code coverage tool when it comes to github pull request integrations; it was buggy at the time of my testing.

CodeCov has the most comprehensive pull request comments including delta values per PR basis. A bit of a hassle to integrate due to the cobertura xml format requirement.

Coveralls is just as good as CodeCov in its pull request comments but perhaps the most hassle to integrate due to the lcov format requirement.

Setup

All three tools work in a similar manner, an uploader is used to upload test output files to their servers. The three tools work with different test output file formats. The tools all require a token and the easiest setup for these tokens is to add them to the repository secrets:

secrets