1414
1515name : Test All Packages
1616
17- on : pull_request
17+ on :
18+ pull_request :
19+ push :
20+ branches :
21+ - main
22+
23+ permissions :
24+ contents : read
1825
1926env :
2027 # make chromedriver detect installed Chrome version and download the corresponding driver
7380 - name : install Chrome stable
7481 run : |
7582 npx @puppeteer/browsers install chrome@stable
83+ - uses : actions/checkout@v4
7684 - name : Download build archive
7785 uses : actions/download-artifact@v4
7886 with :
@@ -98,11 +106,27 @@ jobs:
98106 FIREBASE_TOKEN : ${{ secrets.FIREBASE_CLI_TOKEN }}
99107 - name : Generate coverage file
100108 run : yarn ci:coverage
109+ - name : Merge and fix coverage files for test-the-rest
110+ run : |
111+ # Clear out any existing master file just in case
112+ > ./lcov-all.info
113+
114+ # Find all LCOV files across all packages
115+ find ./packages -type f -name "lcov.info" | while read lcov_file; do
116+ # lcov_file looks like: ./packages/analytics/coverage/lcov.info
117+ # Extract the package name (the 3rd part of the path split by '/')
118+ PKG_NAME=$(echo "$lcov_file" | cut -d'/' -f3)
119+
120+ # Fix the path for this specific package and append it to the master file
121+ sed "s|SF:src/|SF:packages/$PKG_NAME/src/|g" "$lcov_file" >> ./lcov-all.info
122+ done
101123 - name : Run coverage
102124 uses : coverallsapp/github-action@master
103125 with :
104126 github-token : ${{ secrets.GITHUB_TOKEN }}
105127 path-to-lcov : ./lcov-all.info
128+ flag-name : test-the-rest-coverage
129+ parallel : true
106130 continue-on-error : true
107131
108132 test-auth :
@@ -120,6 +144,7 @@ jobs:
120144 echo "::warning ::${CHROME_VERSION_MISMATCH_MESSAGE}"
121145 echo "::warning ::Previously validated version: ${CHROME_VALIDATED_VERSION} vs. Installed version: $chromeVersionString"
122146 fi
147+ - uses : actions/checkout@v4
123148 - name : Download build archive
124149 uses : actions/download-artifact@v4
125150 with :
@@ -144,11 +169,20 @@ jobs:
144169 FIREBASE_TOKEN : ${{ secrets.FIREBASE_CLI_TOKEN }}
145170 - name : Generate coverage file
146171 run : yarn ci:coverage
172+ - name : Merge and fix coverage files for test-auth
173+ run : |
174+ # 1. Smash all Node and Browser coverage files into one giant file
175+ find ./packages/auth/coverage -type f -name "lcov.info" -exec cat {} + > ./lcov-all-auth.info
176+
177+ # 2. Fix standard Node paths
178+ sed -i 's|SF:src/|SF:packages/auth/src/|g' ./lcov-all-auth.info
147179 - name : Run coverage
148180 uses : coverallsapp/github-action@master
149181 with :
150182 github-token : ${{ secrets.GITHUB_TOKEN }}
151- path-to-lcov : ./lcov-all.info
183+ path-to-lcov : ./lcov-all-auth.info
184+ flag-name : test-auth-coverage
185+ parallel : true
152186 continue-on-error : true
153187
154188 test-firestore :
@@ -160,6 +194,7 @@ jobs:
160194 - name : install Chrome stable
161195 run : |
162196 npx @puppeteer/browsers install chrome@stable
197+ - uses : actions/checkout@v4
163198 - name : Download build archive
164199 uses : actions/download-artifact@v4
165200 with :
@@ -184,11 +219,20 @@ jobs:
184219 EXPERIMENTAL_MODE : true
185220 - name : Generate coverage file
186221 run : yarn ci:coverage
222+ - name : Merge and fix coverage files for test-firestore
223+ run : |
224+ # 1. Smash all Node and Browser coverage files into one giant file
225+ find ./packages/firestore/coverage -type f -name "lcov.info" -exec cat {} + > ./lcov-all-firestore.info
226+
227+ # 2. Fix standard Node paths
228+ sed -i 's|SF:src/|SF:packages/firestore/src/|g' ./lcov-all-firestore.info
187229 - name : Run coverage
188230 uses : coverallsapp/github-action@master
189231 with :
190232 github-token : ${{ secrets.GITHUB_TOKEN }}
191- path-to-lcov : ./lcov-all.info
233+ path-to-lcov : ./lcov-all-firestore.info
234+ flag-name : test-firestore-coverage
235+ parallel : true
192236 continue-on-error : true
193237 test-firestore-integration :
194238 strategy :
@@ -203,6 +247,7 @@ jobs:
203247 - name : install Chrome stable
204248 run : |
205249 npx @puppeteer/browsers install chrome@stable
250+ - uses : actions/checkout@v4
206251 - name : Download build archive
207252 uses : actions/download-artifact@v4
208253 with :
@@ -221,3 +266,14 @@ jobs:
221266 working-directory : integration/firestore
222267 env :
223268 FIREBASE_TOKEN : ${{ secrets.FIREBASE_CLI_TOKEN }}
269+
270+ coveralls-finish :
271+ name : Finalize Coveralls
272+ needs : [test-the-rest-coverage, test-auth-coverage, test-firestore-coverage]
273+ runs-on : ubuntu-latest
274+ steps :
275+ - name : Coveralls Finished
276+ uses : coverallsapp/github-action@master
277+ with :
278+ github-token : ${{ secrets.GITHUB_TOKEN }}
279+ parallel-finished : true
0 commit comments