From 86678c92c861f15ea260562e4b32dfe3c75f174c Mon Sep 17 00:00:00 2001 From: Sergej Jaskiewicz Date: Thu, 4 Jul 2019 05:13:45 +0300 Subject: [PATCH] Setup reporting code coverage (#21) --- .codecov.yml | 2 ++ .travis.yml | 11 ++++++++++- README.md | 1 + Tests/PerformanceBaselines/travis-ubuntu-16.04.yml | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..3922952 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,2 @@ +ignore: + - Tests diff --git a/.travis.yml b/.travis.yml index a0e290d..d772d5a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ matrix: - name: "macOS 10.14 | Swift 5.0 | Tests" os: osx osx_image: xcode10.2 - env: SWIFT_VERSION="5.0" + env: SWIFT_VERSION="5.0" CODE_COVERAGE="YES" # - name: "macOS 10.14 | Swift 5.1" # os: osx # osx_image: xcode10.2 @@ -37,6 +37,9 @@ install: - if [[ $TRAVIS_OS_NAME == "linux" ]]; then eval "$(curl -sL https://swiftenv.fuller.li/install.sh)"; fi + - if [[ $CODE_COVERAGE == "YES" ]]; then + gem install xcpretty; + fi script: - if [[ $SWIFT_LINT != "YES" ]]; then swift test -c debug --enable-code-coverage --sanitize thread; @@ -50,3 +53,9 @@ script: - if [[ $SWIFT_LINT == "YES" ]]; then swiftlint lint --strict --reporter "emoji"; fi +after_success: + - if [[ $CODE_COVERAGE == "YES" ]]; then + swift package generate-xcodeproj --enable-code-coverage; + xcodebuild -scheme OpenCombine-Package build test | xcpretty; + bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN; + fi diff --git a/README.md b/README.md index 96a080e..c120fab 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # OpenCombine [![Build Status](https://travis-ci.org/broadwaylamb/OpenCombine.svg?branch=master)](https://travis-ci.org/broadwaylamb/OpenCombine) +[![codecov](https://codecov.io/gh/broadwaylamb/OpenCombine/branch/master/graph/badge.svg)](https://codecov.io/gh/broadwaylamb/OpenCombine) ![Language](https://img.shields.io/badge/Swift-5.0-orange.svg) ![Platform](https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20iOS%20%7C%20watchOS%20%7C%20tvOS-lightgrey.svg) diff --git a/Tests/PerformanceBaselines/travis-ubuntu-16.04.yml b/Tests/PerformanceBaselines/travis-ubuntu-16.04.yml index 0c7ba9e..3251fe1 100644 --- a/Tests/PerformanceBaselines/travis-ubuntu-16.04.yml +++ b/Tests/PerformanceBaselines/travis-ubuntu-16.04.yml @@ -1,5 +1,5 @@ CombineIdentifierTests: testDefaultInitializedPerformance: maxPercentRelativeStandardDeviation: 1e+1 - measurement: 1.15590999999142e-4 + measurement: 1.47168469999883e-4 strategy: minimum