Skip to content

Commit 0c2d2c4

Browse files
author
Michalis Karagiorgos
committed
update workflows yml
1 parent 508b1b5 commit 0c2d2c4

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

.github/workflows/configuration.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,24 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v4
1919
- uses: SwiftyLab/setup-swift@latest
20-
- name: Build
21-
run: swift build
22-
- name: Run tests
20+
- name: Run tests with coverage
2321
run: swift test --enable-code-coverage
24-
- name: Install llvm-cov plugin
25-
run: brew install llvm
26-
- name: Generate coverage report
27-
run: llvm-cov export -format="lcov" .build/debug/XcodeTargetsPackageTests.xctest/Contents/MacOS/XcodeTargetsPackageTests -instr-profile .build/debug/codecov/default.profdata > info.lcov
28-
- name: Upload coverage reports to Codecov
22+
- name: Generate coverage report (lcov)
23+
run: |
24+
set -euo pipefail
25+
BIN_PATH="$(swift build --show-bin-path)"
26+
TEST_BUNDLE="${BIN_PATH}/XcodeTargetsPackageTests.xctest/Contents/MacOS/XcodeTargetsPackageTests"
27+
PROF_DATA="${BIN_PATH}/codecov/default.profdata"
28+
xcrun llvm-cov export \
29+
-format=lcov \
30+
"${TEST_BUNDLE}" \
31+
-instr-profile "${PROF_DATA}" \
32+
> info.lcov
33+
- name: Upload coverage to Codecov
2934
uses: codecov/codecov-action@v5
3035
with:
3136
token: ${{ secrets.CODECOV_TOKEN }}
3237
slug: michaelversus/XcodeTargets
38+
files: info.lcov
39+
fail_ci_if_error: true
40+
verbose: true

0 commit comments

Comments
 (0)