@@ -42,60 +42,12 @@ jobs:
42
42
uses : ./.github/actions/flutter_analysis_and_tests
43
43
with :
44
44
working-directory : ./inherited_widget
45
- read_coverage :
46
- name : Read Combined Coverage Files
45
+ combine_and_upload_coverage :
46
+ name : Combine and Upload Code Coverage
47
47
runs-on : ubuntu-latest
48
48
needs : [todos_repository_local_storage, vanilla, inherited_widget]
49
49
steps :
50
- - name : Checkout repository
51
- uses : actions/checkout@v4
52
- - name : Download coverage artifacts
53
- uses : actions/download-artifact@v4
54
- with :
55
- path : .
56
- - name : Combine coverage files
57
- run : |
58
- combineCoverage() {
59
- local artifact_dir=$1
60
- local repo_dir=$2
61
- # Extract the package directory path from the artifact name
62
- # coverage-lcov-vanilla -> ./vanilla
63
- local package_name=$(basename "$artifact_dir")
64
- local package_dir="./${package_name#coverage-lcov-}"
65
- escapedPath="$(echo $package_dir | sed 's/\//\\\//g')"
66
-
67
- if [[ -d "$artifact_dir" ]]; then
68
- # Find the lcov.info file in the artifact directory
69
- for lcov_file in "$artifact_dir"/*.info; do
70
- if [[ -f "$lcov_file" ]]; then
71
- echo "Combining coverage from $package_dir"
72
- # combine line coverage info from package tests to a common file
73
- sed "s/^SF:lib/SF:$escapedPath\/lib/g" "$lcov_file" >> "$repo_dir/lcov.info"
74
- break
75
- fi
76
- done
77
- fi
78
- }
79
-
80
- # Initialize the combined coverage file
81
- touch lcov.info
82
-
83
- # Combine coverage from all downloaded artifacts
84
- for artifact_dir in coverage-lcov-*/; do
85
- if [[ -d "$artifact_dir" ]]; then
86
- combineCoverage "$artifact_dir" "."
87
- fi
88
- done
89
-
90
- echo "Combined coverage file created:"
91
- ls -la lcov.info
92
- echo "First few lines of combined coverage:"
93
- head -10 lcov.info
94
-
95
50
- name : Upload coverage to Codecov
96
51
uses : codecov/codecov-action@v5
97
- with :
98
- files : ./lcov.info
99
- disable_search : true
100
52
env :
101
53
CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
0 commit comments