Skip to content

Commit 4d1216d

Browse files
committed
Add debug commands
1 parent dfa71c9 commit 4d1216d

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/coverage.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0 # Fetch all history for proper source code mapping
1618

1719
- uses: subosito/flutter-action@v2
1820
with:
@@ -89,8 +91,36 @@ jobs:
8991
run: |
9092
dart pub global run combine_coverage:combine_coverage --repo-path="./" --output-directory="coverage"
9193
94+
- name: Prepare coverage for Coveralls
95+
run: |
96+
# Make sure source file paths are correct in the LCOV file
97+
echo "LCOV file contents (first few lines):"
98+
head -n 20 ./coverage/lcov.info
99+
100+
# Check if source files exist in the expected locations
101+
grep -A 1 "SF:" ./coverage/lcov.info | head -n 10
102+
103+
# Verify file paths in the repository
104+
find . -type f -name "*.dart" | head -n 10
105+
106+
# If needed, fix paths by ensuring they're relative to the workspace instead of absolute
107+
# This pattern replaces absolute paths and ensures paths are relative to repo root
108+
sed -i -E 's|SF:(/[^/]+)*?/packages/|SF:packages/|g' ./coverage/lcov.info
109+
110+
echo "Updated LCOV file contents (first few lines):"
111+
head -n 20 ./coverage/lcov.info
112+
113+
# Create a list of source files that are referenced in the LCOV file
114+
echo "Creating list of source files referenced in LCOV"
115+
grep "SF:" ./coverage/lcov.info | sed 's/SF://' | sort > source_files.txt
116+
echo "First 10 source files referenced:"
117+
head -n 10 source_files.txt
118+
92119
- name: Upload combined coverage report
93120
uses: coverallsapp/github-action@v2
94121
with:
95122
github-token: ${{ secrets.GITHUB_TOKEN }}
96123
path-to-lcov: ./coverage/lcov.info
124+
base-path: ${{ github.workspace }}
125+
flag-name: Unit
126+
debug: true

0 commit comments

Comments
 (0)