Skip to content

Commit b4d1563

Browse files
Trying to fix codecov upload
1 parent 7a8e54f commit b4d1563

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/swift.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,20 @@ jobs:
1010
- uses: swift-actions/setup-swift@v2.3.0
1111
with:
1212
swift-version: 6.1.0
13-
- name: Run tests and generate coverage
13+
- name: Run tests
14+
run: swift test --enable-code-coverage
15+
- name: Generate coverage report
1416
id: test
1517
run: |
16-
swift test
17-
COVERAGE_PATH=$(swift test --show-codecov-path)
18-
TEST_BUNDLE=$(ls .build/debug/*.xctest | head -n 1)
19-
xcrun llvm-cov export -format=lcov -instr-profile="$COVERAGE_PATH" "$TEST_BUNDLE/Contents/MacOS/$(basename "$TEST_BUNDLE" .xctest)" > lcov.info
18+
CODECOV_PATH=$(swift test --show-codecov-path)
19+
PROFDATA_PATH=$(dirname "$CODECOV_PATH")/default.profdata
20+
21+
ALL_OBJECT_FILES=$(find .build -name "*.o" -type f)
22+
SOURCE_OBJECT_FILES=$(echo "$ALL_OBJECT_FILES" | grep "MarkdownSyntaxTests.build")
23+
24+
xcrun llvm-cov report -instr-profile $PROFDATA_PATH $SOURCE_OBJECT_FILES
25+
26+
xcrun llvm-cov export --format="lcov" -instr-profile $PROFDATA_PATH $SOURCE_OBJECT_FILES >> lcov.info
2027
- name: Upload coverage to Codecov
2128
uses: codecov/codecov-action@v5.4.3
2229
with:

0 commit comments

Comments
 (0)