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