Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

build: output coverage report using xcov-danger #14

Merged
merged 1 commit into from
Sep 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ identifier_name:
excluded:
- Pods
- RemoteConfigPlayground.playground
- vendor
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ xcode_scheme: Tests
osx_image: xcode10.2

before_install:
- gem install xcov
- gem update fastlane cocoapods xcov --no-document
- bundle install
- gem update fastlane cocoapods --no-document
- pod repo update

script: fastlane ci
script:
- fastlane ci
- bundle exec danger

after_success:
# generate docs
- gem install jazzy
- jazzy --xcodebuild-arguments -scheme,Tests --module RRemoteConfig --source-directory RRemoteConfig --podspec RRemoteConfig.podspec --exclude RRemoteConfig/Loader.swift --readme README.md

deploy:
Expand Down
13 changes: 13 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Warn when there is a big PR
warn("Big PR") if git.lines_of_code > 500

xcov.report(
workspace: 'RRemoteConfig.xcworkspace',
scheme: 'Tests',
output_directory: 'artifacts/unit-tests/coverage',
source_directory: 'RRemoteConfig',
json_report: true,
include_targets: 'RRemoteConfig.framework',
include_test_targets: false,
minimum_coverage_percentage: 70.0
)
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source 'https://rubygems.org'

gem "cocoapods"
gem "xcov"
gem "jazzy"
gem "danger"
gem "danger-xcov"
gem "xcode-install"
24 changes: 11 additions & 13 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ default_platform(:ios)
platform :ios do
desc "Build everything"
lane :ci do |options|
xcversion(version: "~> 10.2")

swiftlint(
strict: true,
ignore_exit_status: false
Expand All @@ -22,7 +24,12 @@ platform :ios do
output_types: 'json-compilation-database,html,junit',
output_files: 'compile_commands.json,report.html,report.junit')

coverage
if is_ci?
puts "Running on CI, coverage report will be generated by Danger"
else
puts "Running locally so call coverage lane"
coverage
end
end

desc "Set up environment"
Expand All @@ -41,18 +48,9 @@ platform :ios do

desc "Generate code coverage"
lane :coverage do |options|
xcov(
workspace: 'RRemoteConfig.xcworkspace',
scheme: 'Tests',
output_directory: 'artifacts/unit-tests/coverage',
source_directory: 'RRemoteConfig',
json_report: true,
include_targets: 'RRemoteConfig.framework',
include_test_targets: false,
skip_slack: true,
disable_coveralls: false,
minimum_coverage_percentage: 70.0
)
Dir.chdir("..") do
sh("bundle exec danger dry_run")
end
end
end
# vim:syntax=ruby:et:sts=2:sw=2:ts=2:ff=unix: