|
13 | 13 |
|
14 | 14 | steps: |
15 | 15 | - uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + fetch-depth: 0 # Fetch all history for proper source code mapping |
16 | 18 |
|
17 | 19 | - uses: subosito/flutter-action@v2 |
18 | 20 | with: |
|
89 | 91 | run: | |
90 | 92 | dart pub global run combine_coverage:combine_coverage --repo-path="./" --output-directory="coverage" |
91 | 93 | |
| 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 | + |
92 | 119 | - name: Upload combined coverage report |
93 | 120 | uses: coverallsapp/github-action@v2 |
94 | 121 | with: |
95 | 122 | github-token: ${{ secrets.GITHUB_TOKEN }} |
96 | 123 | path-to-lcov: ./coverage/lcov.info |
| 124 | + base-path: ${{ github.workspace }} |
| 125 | + flag-name: Unit |
| 126 | + debug: true |
0 commit comments