From b58c42cbd33fa2b611fe7af1ce044663999812bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20S=CC=81wierad?= Date: Fri, 10 Apr 2020 11:57:26 +0200 Subject: [PATCH] Added codecov for gathering coverage data --- .github/workflows/examle.yml | 5 +++-- .github/workflows/package.yml | 23 ++++++++++++++++++++--- .gitignore | 1 + README.md | 1 + 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.github/workflows/examle.yml b/.github/workflows/examle.yml index 46bb15c..48fada6 100644 --- a/.github/workflows/examle.yml +++ b/.github/workflows/examle.yml @@ -15,12 +15,13 @@ jobs: DEVELOPMENT_TEAM_ID: ${{ secrets.DEVELOPMENT_TEAM_ID }} steps: - - uses: actions/checkout@v2 + - name: Checkout branch + uses: actions/checkout@v2 - name: Install gettext run: | brew install gettext - brew link --force gettext + brew link --force gettext - name: Set up config files run: envsubst < Restler-Example/Configuration/env_debug.xcconfig.tpl > Restler-Example/Configuration/Debug.xcconfig diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 580622d..01c0c2c 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -10,7 +10,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout branch + uses: actions/checkout@v2 - name: SwiftLint uses: norio-nomura/action-swiftlint@3.1.0 @@ -18,7 +19,8 @@ jobs: runs-on: macos-latest steps: - - uses: actions/checkout@v2 + - name: Checkout branch + uses: actions/checkout@v2 - name: Lint podspec run: pod lib lint @@ -26,8 +28,23 @@ jobs: runs-on: macos-latest steps: - - uses: actions/checkout@v2 + - name: Checkout branch + uses: actions/checkout@v2 + - name: Build run: swift build + - name: Run tests run: swift test --enable-code-coverage + + - name: Generate code coverage report + run: xcrun llvm-cov export -format="lcov" .build/debug/RestlerPackageTests.xctest/Contents/MacOS/RestlerPackageTests + -instr-profile .build/debug/codecov/default.profdata + --ignore-filename-regex="Test|Mock" + > info.lcov + + - name: Upload code coverage report + uses: coverallsapp/github-action@v1.0.1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: ./info.lcov diff --git a/.gitignore b/.gitignore index d9807b7..3b6fa28 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /output *.xcconfig /muter_logs +*.lcov diff --git a/README.md b/README.md index 76f2bb1..dd497a5 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Package Build Status](https://github.com/railwaymen/restler/workflows/Package%20Actions/badge.svg)](https://github.com/railwaymen/restler/actions) [![Example App Build Status](https://github.com/railwaymen/restler/workflows/Example%20App%20Actions/badge.svg)](https://github.com/railwaymen/restler/actions) +[![Coverage Status](https://coveralls.io/repos/github/railwaymen/restler/badge.svg?branch=master)](https://coveralls.io/github/railwaymen/restler?branch=master) The Restler framework has been built to use features of the newest versions of Swift. Inspiration for it is Vapor library for building Server-side with Swift. What we love is functional programming, so you can build your desired request just calling some chained functions. The main goal of the framework is to provide nice interface for making API requests the easiest as possible and the fastest as possible.