diff --git a/.github/codecov.yaml b/.github/codecov.yaml new file mode 100644 index 0000000..5077db3 --- /dev/null +++ b/.github/codecov.yaml @@ -0,0 +1,5 @@ +coverage: + status: + project: + default: + threshold: 5% diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..25b8ece --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,8 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + reviewers: + - "slashmo" diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index b5fdc31..35d7e0a 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -12,3 +12,4 @@ jobs: unit_test: name: Unit Test uses: ./.github/workflows/unit-test.yaml + secrets: inherit diff --git a/.github/workflows/unit-test.yaml b/.github/workflows/unit-test.yaml index 8489905..098b9a2 100644 --- a/.github/workflows/unit-test.yaml +++ b/.github/workflows/unit-test.yaml @@ -28,3 +28,18 @@ jobs: run: swift package resolve - name: Run Unit Tests run: swift test --parallel --enable-code-coverage + - name: Merge code coverage + run: | + llvm-cov export -format "lcov" \ + .build/debug/swift-ofrepPackageTests.xctest \ + -ignore-filename-regex="\/Tests\/" \ + -ignore-filename-regex="\/Generated\/" \ + -ignore-filename-regex="\/.build\/" \ + -instr-profile=./.build/debug/codecov/default.profdata \ + > info.lcov + - name: Upload code coverage report to Codecov + uses: codecov/codecov-action@v5.1.2 + with: + files: ./info.lcov + fail_ci_if_error: true + token: "${{ secrets.CODECOV_TOKEN }}" diff --git a/README.md b/README.md index 8ae2c78..d88c9fa 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Swift OFREP [![Unit Test](https://github.com/swift-open-feature/swift-ofrep/actions/workflows/unit-test.yaml/badge.svg)](https://github.com/swift-open-feature/swift-ofrep/actions/workflows/unit-test.yaml) +[![codecov](https://codecov.io/gh/swift-open-feature/swift-ofrep/graph/badge.svg?token=YK7Y25KOFU)](https://codecov.io/gh/swift-open-feature/swift-ofrep) A cross-platform [OFREP](https://github.com/open-feature/protocol) provider for Swift, based on [Swift OpenFeature](https://github.com/swift-open-feature/swift-open-feature).