Skip to content

Commit

Permalink
Enable code coverage on master
Browse files Browse the repository at this point in the history
  • Loading branch information
dfed committed Jan 17, 2020
1 parent 1e0caed commit c6a789f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ DerivedData
.idea/
.swiftpm/
generated/
*coverage.txt
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,30 @@ matrix:
env: ACTION="swift-package";PLATFORMS="iOS_13,tvOS_13,macOS_10_15,watchOS_6";
- osx_image: xcode11
env: ACTION="xcode";PLATFORMS="iOS_13,tvOS_13,macOS_10_15,watchOS_6";
after_success:
- bash <(curl -s https://codecov.io/bash) -J '^Valet$' -D .build/derivedData/iOS_13 -t 5165deef-da9c-443d-90ea-bb0620bffe44
- bash <(curl -s https://codecov.io/bash) -J '^Valet$' -D .build/derivedData/tvOS_13 -t 5165deef-da9c-443d-90ea-bb0620bffe44
- bash <(curl -s https://codecov.io/bash) -J '^Valet$' -D .build/derivedData/macOS_10_15 -t 5165deef-da9c-443d-90ea-bb0620bffe44
- osx_image: xcode11
env: ACTION="carthage"

- osx_image: xcode10.2
env: ACTION="xcode";PLATFORMS="iOS_12,tvOS_12,macOS_10_14,watchOS_5";
after_success:
- bash <(curl -s https://codecov.io/bash) -J '^Valet$' -D .build/derivedData/iOS_12 -t 5165deef-da9c-443d-90ea-bb0620bffe44
- bash <(curl -s https://codecov.io/bash) -J '^Valet$' -D .build/derivedData/tvOS_12 -t 5165deef-da9c-443d-90ea-bb0620bffe44
- bash <(curl -s https://codecov.io/bash) -J '^Valet$' -D .build/derivedData/macOS_10_14 -t 5165deef-da9c-443d-90ea-bb0620bffe44
- osx_image: xcode10.2
env: ACTION="pod-lint";SWIFT_VERSION="5.0"
- osx_image: xcode10.2
env: ACTION="carthage"

- osx_image: xcode9
env: ACTION="xcode";PLATFORMS="iOS_11,tvOS_11,macOS_10_13,watchOS_4";
after_success:
- bash <(curl -s https://codecov.io/bash) -J '^Valet$' -D .build/derivedData/iOS_11 -t 5165deef-da9c-443d-90ea-bb0620bffe44
- bash <(curl -s https://codecov.io/bash) -J '^Valet$' -D .build/derivedData/tvOS_11 -t 5165deef-da9c-443d-90ea-bb0620bffe44
- bash <(curl -s https://codecov.io/bash) -J '^Valet$' -D .build/derivedData/macOS_10_13 -t 5165deef-da9c-443d-90ea-bb0620bffe44
- osx_image: xcode9
env: ACTION="pod-lint";SWIFT_VERSION="4.0"
- osx_image: xcode9
Expand Down
13 changes: 12 additions & 1 deletion Scripts/build.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ enum Platform: String, CustomStringConvertible {
}
}

var derivedDataPath: String {
return ".build/derivedData/" + description
}

var scheme: String {
switch self {
case .iOS_11,
Expand Down Expand Up @@ -243,8 +247,15 @@ for rawPlatform in rawPlatforms {
if task.shouldUseLegacyBuildSystem {
xcodeBuildArguments.append("-UseModernBuildSystem=0")
}
let shouldTest = task.shouldTest(on: platform)
if shouldTest {
xcodeBuildArguments.append("-enableCodeCoverage")
xcodeBuildArguments.append("YES")
xcodeBuildArguments.append("-derivedDataPath")
xcodeBuildArguments.append(platform.derivedDataPath)
}
xcodeBuildArguments.append("build")
if task.shouldTest(on: platform) {
if shouldTest {
xcodeBuildArguments.append("test")
}

Expand Down
7 changes: 7 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
codecov:
require_ci_to_pass: yes

comment:
layout: "reach,diff,flags,tree"
behavior: default
require_changes: no

0 comments on commit c6a789f

Please sign in to comment.