File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -51,12 +51,28 @@ jobs:
5151
5252 - name : Generate Code Coverage
5353 run : |
54+ # Find the actual test executable (SPM naming can vary)
55+ TEST_EXECUTABLE=$(find .build/debug -name "*PackageTests.xctest" -type d | head -1)
56+ if [ -z "$TEST_EXECUTABLE" ]; then
57+ echo "No test executable found, skipping coverage"
58+ exit 0
59+ fi
60+
61+ EXECUTABLE_NAME=$(basename "$TEST_EXECUTABLE" .xctest)
62+ EXECUTABLE_PATH="$TEST_EXECUTABLE/Contents/MacOS/$EXECUTABLE_NAME"
63+
64+ if [ ! -f "$EXECUTABLE_PATH" ]; then
65+ echo "Test executable not found at $EXECUTABLE_PATH, skipping coverage"
66+ exit 0
67+ fi
68+
5469 xcrun llvm-cov export \
55- .build/debug/swift-ui-debug-scanPackageTests.xctest/Contents/MacOS/swift-ui-debug-scanPackageTests \
70+ "$EXECUTABLE_PATH" \
5671 -instr-profile .build/debug/codecov/default.profdata \
5772 -format="lcov" > coverage.lcov
5873
5974 - name : Upload Code Coverage
75+ if : hashFiles('coverage.lcov') != ''
6076 uses : codecov/codecov-action@v4
6177 with :
6278 file : coverage.lcov
Original file line number Diff line number Diff line change 3434 # Try to extract release notes from CHANGELOG.md if it exists
3535 if [ -f CHANGELOG.md ]; then
3636 # Extract content between the first two version headers
37- VERSION_LINE=$(grep -n "^## \[* ${{ github.ref_name }}" CHANGELOG.md | head -1 | cut -d: -f1)
37+ VERSION_LINE=$(grep -n "^## \[? ${{ github.ref_name }}\]? " CHANGELOG.md | head -1 | cut -d: -f1)
3838 if [ ! -z "$VERSION_LINE" ]; then
3939 NEXT_VERSION_LINE=$(tail -n +$((VERSION_LINE + 1)) CHANGELOG.md | grep -n "^## " | head -1 | cut -d: -f1)
4040 if [ ! -z "$NEXT_VERSION_LINE" ]; then
You can’t perform that action at this time.
0 commit comments