Skip to content

Commit 3fdebff

Browse files
committed
dataconnect.yml: ensure that test logs are uploaded even when the tests fail
1 parent 9a1550f commit 3fdebff

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

.github/workflows/dataconnect.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,12 @@ jobs:
175175
${{ env.FDC_FIREBASE_COMMAND }} emulators:start --only=auth >firebase.emulator.auth.log 2>&1 &
176176
177177
- name: Gradle connectedCheck
178+
id: connectedCheck
178179
uses: reactivecircus/android-emulator-runner@v2
180+
# Allow this GitHub Actions "job" to continue even if the tests fail so that logs from a
181+
# failed test run get uploaded as "artifacts" and are available to investigate failed runs.
182+
# A later step in this "job" will fail the job if this step fails
183+
continue-on-error: true
179184
with:
180185
api-level: ${{ env.FDC_ANDROID_EMULATOR_API_LEVEL }}
181186
arch: x86_64
@@ -185,21 +190,28 @@ jobs:
185190
script: |
186191
set -eux && ./gradlew ${{ (inputs.gradleInfoLog && '--info') || '' }} :firebase-dataconnect:connectedCheck :firebase-dataconnect:connectors:connectedCheck
187192
188-
- uses: actions/upload-artifact@v4
189-
if: true
193+
- name: Upload log file artifacts
194+
uses: actions/upload-artifact@v4
190195
with:
191196
name: logs
192197
path: "**/*.log"
193198
if-no-files-found: warn
194199
compression-level: 9
195200

196-
- uses: actions/upload-artifact@v4
201+
- name: Upload Gradle build report artifacts
202+
uses: actions/upload-artifact@v4
197203
with:
198204
name: gradle_build_reports
199205
path: firebase-dataconnect/**/build/reports/
200206
if-no-files-found: warn
201207
compression-level: 9
202208

209+
- name: Check test result
210+
if: steps.connectedCheck.outcome != 'success'
211+
run: |
212+
echo "Failing the job since the connectedCheck step failed"
213+
exit 1
214+
203215
# Check this yml file with "actionlint": https://github.com/rhysd/actionlint
204216
# To run actionlint yourself, run `brew install actionlint` followed by
205217
# `actionlint .github/workflows/dataconnect.yml`

0 commit comments

Comments
 (0)