From 3fc8ba504a33fabe38555cc82313076e6946e347 Mon Sep 17 00:00:00 2001 From: Corey Date: Sun, 7 Jul 2024 20:58:34 -0700 Subject: [PATCH] ci: Add codecov (#13) * Create .codecov.yml * Update ci.yml * create codecov files * Update ci.yml * Update .codecov.yml * Update README.md * Update .codecov.yml --- .codecov.yml | 14 ++++++++++++++ .github/workflows/ci.yml | 6 +++++- CareKitEssentials.xctestplan | 1 - README.md | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..af8547fe --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,14 @@ +coverage: + ignore: + - Tests/.* + - TestHost/* + status: + patch: + default: + target: 0 + changes: false + project: + default: + target: 2 +comment: + require_changes: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48edb744..3cbd8620 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: runs-on: macos-14 strategy: matrix: - destination: ['platform=iOS\ Simulator,name=iPhone\ 15\ Pro\ Max', 'platform=watchOS\ Simulator,name=Apple\ Watch\ Series\ 9\ \(41mm\)', 'platform=macOS CODE_SIGN_IDENTITY=""', 'platform=visionOS\ Simulator,OS=1.2,name=Apple\ Vision\ Pro CODE_SIGN_IDENTITY=""'] + destination: ['platform=iOS\ Simulator,OS=17.5,name=iPhone\ 15\ Pro\ Max', 'platform=watchOS\ Simulator,name=Apple\ Watch\ Series\ 9\ \(41mm\)', 'platform=macOS CODE_SIGN_IDENTITY=""', 'platform=visionOS\ Simulator,OS=1.2,name=Apple\ Vision\ Pro CODE_SIGN_IDENTITY=""'] action: ['test', 'build'] exclude: - destination: 'platform=iOS\ Simulator,OS=17.5,name=iPhone\ 15\ Pro\ Max' @@ -39,6 +39,9 @@ jobs: run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -scheme CareKitEssentials -derivedDataPath DerivedData -destination ${{ matrix.destination }} ${{ matrix.action }} | xcpretty -c env: DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }} + - name: Upload codecov yml + run: | + cat .codecov.yml | curl --data-binary @- https://codecov.io/validate - name: Prepare codecov uses: sersoft-gmbh/swift-coverage-action@v4 id: coverage-files @@ -52,6 +55,7 @@ jobs: with: files: ${{join(fromJSON(steps.coverage-files.outputs.files), ',')}} fail_ci_if_error: false + token: ${{ secrets.CODECOV_TOKEN }} env: DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }} diff --git a/CareKitEssentials.xctestplan b/CareKitEssentials.xctestplan index 2ec1ce42..6fe2b576 100644 --- a/CareKitEssentials.xctestplan +++ b/CareKitEssentials.xctestplan @@ -9,7 +9,6 @@ } ], "defaultOptions" : { - "codeCoverage" : false, "testExecutionOrdering" : "random", "testRepetitionMode" : "retryOnFailure" }, diff --git a/README.md b/README.md index 5fe9fa8d..b4e312c1 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fnetreconlab%2FCareKitEssentials%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/netreconlab/CareKitEssentials) ![Xcode 13.2+](https://img.shields.io/badge/xcode-13.2%2B-blue.svg) [![CI Status](https://github.com/netreconlab/CareKitEssentials/workflows/ci/badge.svg?branch=main)](https://github.com/netreconlab/CareKitEssentials/actions?query=workflow%3Aci) -![Codecov](https://codecov.io/gh/netreconlab/CareKitEssentials/branches/main/graph/badge.svg) +[![Coverage](https://codecov.io/gh/netreconlab/CareKitEssentialst/branch/main/graph/badge.svg)](https://app.codecov.io/gh/netreconlab/CareKitEssentials/branch/main) [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/netreconlab/ParseCareKit/#license) Provides essential cards, views, models, protocols, and extensions to expedite building [CareKit](https://github.com/carekit-apple/CareKit) based applications.