Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,31 @@ jobs:
run: swift build

- name: Test
run: swift test
run: swift test --enable-code-coverage

# Export coverage as lcov, restricted to library sources. The
# -ignore-filename-regex drops test files, the Demo app, and all
# dependency/build-artifact code so the badge reflects library coverage
# only. Paths are absolute in llvm-cov output, so these fragments match
# anywhere in the checkout.
- name: Export code coverage
run: |
BIN_PATH="$(swift build --show-bin-path)"
XCTEST="$(find "${BIN_PATH}" -maxdepth 1 -name '*.xctest' | head -1)"
COV_BIN="${XCTEST}/Contents/MacOS/$(basename "${XCTEST}" .xctest)"
xcrun llvm-cov export \
-format=lcov \
-instr-profile "${BIN_PATH}/codecov/default.profdata" \
"${COV_BIN}" \
-ignore-filename-regex='(\.build|Tests|Demo)/' \
> coverage.lcov

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: coverage.lcov
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

docc:
name: DocC catalog
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ReliaBLE

[![CI](https://github.com/Five3Apps/ReliaBLE/actions/workflows/ci.yml/badge.svg)](https://github.com/Five3Apps/ReliaBLE/actions/workflows/ci.yml)
[![CI](https://github.com/Five3Apps/ReliaBLE/actions/workflows/ci.yml/badge.svg)](https://github.com/Five3Apps/ReliaBLE/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/Five3Apps/ReliaBLE/branch/master/graph/badge.svg)](https://codecov.io/gh/Five3Apps/ReliaBLE)

A reliable, modern, and easy-to-use Swift package for apps that talk to Bluetooth Low Energy (BLE) peripherals.

Expand Down
25 changes: 25 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Codecov configuration for ReliaBLE.
#
# Coverage is measured for the library sources only. The CI workflow already
# filters test files, the Demo app, and dependencies out of the uploaded lcov
# report via llvm-cov's -ignore-filename-regex; the ignore list below is a
# second line of defence so those paths never count toward coverage even if the
# export filter changes.
coverage:
status:
project:
default:
target: auto
threshold: 1%
patch:
default:
target: auto

ignore:
- "Tests"
- "Demo"
- "**/.build/**"

comment:
layout: "reach, diff, files"
require_changes: true
Loading