File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments