Move from continue_on_error to if: always().

This will allow previous steps to explicitly fail and be marked as failed
but later steps will continue to run in order to display the outcomes.

(there's probably a better way to do this, but this will at least start
to expose the errors in the UI)
This commit is contained in:
Michael Kaye 2022-02-23 18:00:54 +00:00
parent 9e9dc1defd
commit 9e7079dff6

View file

@ -10,7 +10,7 @@ env:
CI_GRADLE_ARG_PROPERTIES: > CI_GRADLE_ARG_PROPERTIES: >
-Porg.gradle.jvmargs=-Xmx2g -Porg.gradle.jvmargs=-Xmx2g
-Porg.gradle.parallel=false -Porg.gradle.parallel=false
-PallWarningsAsErrors=false
jobs: jobs:
# Build Android Tests [Matrix SDK] # Build Android Tests [Matrix SDK]
build-android-test-matrix-sdk: build-android-test-matrix-sdk:
@ -27,7 +27,7 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-gradle- ${{ runner.os }}-gradle-
- name: Build Android Tests for matrix-sdk-android - name: Build Android Tests for matrix-sdk-android
run: ./gradlew clean matrix-sdk-android:assembleAndroidTest $CI_GRADLE_ARG_PROPERTIES --stacktrace -PallWarningsAsErrors=false run: ./gradlew clean matrix-sdk-android:assembleAndroidTest $CI_GRADLE_ARG_PROPERTIES --stacktrace
# Build Android Tests [Matrix APP] # Build Android Tests [Matrix APP]
build-android-test-app: build-android-test-app:
@ -44,7 +44,7 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-gradle- ${{ runner.os }}-gradle-
- name: Build Android Tests for vector - name: Build Android Tests for vector
run: ./gradlew clean vector:assembleAndroidTest $CI_GRADLE_ARG_PROPERTIES --stacktrace -PallWarningsAsErrors=false run: ./gradlew clean vector:assembleAndroidTest $CI_GRADLE_ARG_PROPERTIES --stacktrace
# Run Android Tests # Run Android Tests
integration-tests: integration-tests:
@ -91,7 +91,6 @@ jobs:
./start.sh --no-rate-limit ./start.sh --no-rate-limit
# package: org.matrix.android.sdk.session # package: org.matrix.android.sdk.session
- name: Run integration tests for Matrix SDK [org.matrix.android.sdk.session] API[${{ matrix.api-level }}] - name: Run integration tests for Matrix SDK [org.matrix.android.sdk.session] API[${{ matrix.api-level }}]
continue-on-error: true
uses: reactivecircus/android-emulator-runner@v2 uses: reactivecircus/android-emulator-runner@v2
with: with:
api-level: ${{ matrix.api-level }} api-level: ${{ matrix.api-level }}
@ -102,14 +101,14 @@ jobs:
emulator-build: 7425822 emulator-build: 7425822
script: ./gradlew $CI_GRADLE_ARG_PROPERTIES -Pandroid.testInstrumentationRunnerArguments.package='org.matrix.android.sdk.session' matrix-sdk-android:connectedDebugAndroidTest script: ./gradlew $CI_GRADLE_ARG_PROPERTIES -Pandroid.testInstrumentationRunnerArguments.package='org.matrix.android.sdk.session' matrix-sdk-android:connectedDebugAndroidTest
- name: Read Results [org.matrix.android.sdk.session] - name: Read Results [org.matrix.android.sdk.session]
continue-on-error: true if: always()
id: get-comment-body-session id: get-comment-body-session
run: | run: |
body="$(cat ./matrix-sdk-android/build/outputs/androidTest-results/connected/*.xml | grep "<testsuite" | sed "s@.*tests=\(.*\)time=.*@\1@")" body="$(cat ./matrix-sdk-android/build/outputs/androidTest-results/connected/*.xml | grep "<testsuite" | sed "s@.*tests=\(.*\)time=.*@\1@")"
echo "::set-output name=session::passed=$body" echo "::set-output name=session::passed=$body"
# package: org.matrix.android.sdk.account # package: org.matrix.android.sdk.account
- name: Run integration tests for Matrix SDK [org.matrix.android.sdk.account] API[${{ matrix.api-level }}] - name: Run integration tests for Matrix SDK [org.matrix.android.sdk.account] API[${{ matrix.api-level }}]
continue-on-error: true if: always()
uses: reactivecircus/android-emulator-runner@v2 uses: reactivecircus/android-emulator-runner@v2
with: with:
api-level: ${{ matrix.api-level }} api-level: ${{ matrix.api-level }}
@ -120,14 +119,14 @@ jobs:
emulator-build: 7425822 emulator-build: 7425822
script: ./gradlew $CI_GRADLE_ARG_PROPERTIES -Pandroid.testInstrumentationRunnerArguments.package='org.matrix.android.sdk.account' matrix-sdk-android:connectedDebugAndroidTest script: ./gradlew $CI_GRADLE_ARG_PROPERTIES -Pandroid.testInstrumentationRunnerArguments.package='org.matrix.android.sdk.account' matrix-sdk-android:connectedDebugAndroidTest
- name: Read Results [org.matrix.android.sdk.account] - name: Read Results [org.matrix.android.sdk.account]
continue-on-error: true if: always()
id: get-comment-body-account id: get-comment-body-account
run: | run: |
body="$(cat ./matrix-sdk-android/build/outputs/androidTest-results/connected/*.xml | grep "<testsuite" | sed "s@.*tests=\(.*\)time=.*@\1@")" body="$(cat ./matrix-sdk-android/build/outputs/androidTest-results/connected/*.xml | grep "<testsuite" | sed "s@.*tests=\(.*\)time=.*@\1@")"
echo "::set-output name=account::passed=$body" echo "::set-output name=account::passed=$body"
# package: org.matrix.android.sdk.internal # package: org.matrix.android.sdk.internal
- name: Run integration tests for Matrix SDK [org.matrix.android.sdk.internal] API[${{ matrix.api-level }}] - name: Run integration tests for Matrix SDK [org.matrix.android.sdk.internal] API[${{ matrix.api-level }}]
continue-on-error: true if: always()
uses: reactivecircus/android-emulator-runner@v2 uses: reactivecircus/android-emulator-runner@v2
with: with:
api-level: ${{ matrix.api-level }} api-level: ${{ matrix.api-level }}
@ -138,14 +137,14 @@ jobs:
emulator-build: 7425822 emulator-build: 7425822
script: ./gradlew $CI_GRADLE_ARG_PROPERTIES -Pandroid.testInstrumentationRunnerArguments.package='org.matrix.android.sdk.internal' matrix-sdk-android:connectedDebugAndroidTest script: ./gradlew $CI_GRADLE_ARG_PROPERTIES -Pandroid.testInstrumentationRunnerArguments.package='org.matrix.android.sdk.internal' matrix-sdk-android:connectedDebugAndroidTest
- name: Read Results [org.matrix.android.sdk.internal] - name: Read Results [org.matrix.android.sdk.internal]
continue-on-error: true if: always()
id: get-comment-body-internal id: get-comment-body-internal
run: | run: |
body="$(cat ./matrix-sdk-android/build/outputs/androidTest-results/connected/*.xml | grep "<testsuite" | sed "s@.*tests=\(.*\)time=.*@\1@")" body="$(cat ./matrix-sdk-android/build/outputs/androidTest-results/connected/*.xml | grep "<testsuite" | sed "s@.*tests=\(.*\)time=.*@\1@")"
echo "::set-output name=internal::passed=$body" echo "::set-output name=internal::passed=$body"
# package: org.matrix.android.sdk.ordering # package: org.matrix.android.sdk.ordering
- name: Run integration tests for Matrix SDK [org.matrix.android.sdk.ordering] API[${{ matrix.api-level }}] - name: Run integration tests for Matrix SDK [org.matrix.android.sdk.ordering] API[${{ matrix.api-level }}]
continue-on-error: true if: always()
uses: reactivecircus/android-emulator-runner@v2 uses: reactivecircus/android-emulator-runner@v2
with: with:
api-level: ${{ matrix.api-level }} api-level: ${{ matrix.api-level }}
@ -156,14 +155,14 @@ jobs:
emulator-build: 7425822 emulator-build: 7425822
script: ./gradlew $CI_GRADLE_ARG_PROPERTIES -Pandroid.testInstrumentationRunnerArguments.package='org.matrix.android.sdk.ordering' matrix-sdk-android:connectedDebugAndroidTest script: ./gradlew $CI_GRADLE_ARG_PROPERTIES -Pandroid.testInstrumentationRunnerArguments.package='org.matrix.android.sdk.ordering' matrix-sdk-android:connectedDebugAndroidTest
- name: Read Results [org.matrix.android.sdk.ordering] - name: Read Results [org.matrix.android.sdk.ordering]
continue-on-error: true if: always()
id: get-comment-body-ordering id: get-comment-body-ordering
run: | run: |
body="$(cat ./matrix-sdk-android/build/outputs/androidTest-results/connected/*.xml | grep "<testsuite" | sed "s@.*tests=\(.*\)time=.*@\1@")" body="$(cat ./matrix-sdk-android/build/outputs/androidTest-results/connected/*.xml | grep "<testsuite" | sed "s@.*tests=\(.*\)time=.*@\1@")"
echo "::set-output name=ordering::passed=$body" echo "::set-output name=ordering::passed=$body"
# package: class PermalinkParserTest # package: class PermalinkParserTest
- name: Run integration tests for Matrix SDK class [org.matrix.android.sdk.PermalinkParserTest] API[${{ matrix.api-level }}] - name: Run integration tests for Matrix SDK class [org.matrix.android.sdk.PermalinkParserTest] API[${{ matrix.api-level }}]
continue-on-error: true if: always()
uses: reactivecircus/android-emulator-runner@v2 uses: reactivecircus/android-emulator-runner@v2
with: with:
api-level: ${{ matrix.api-level }} api-level: ${{ matrix.api-level }}
@ -174,13 +173,13 @@ jobs:
emulator-build: 7425822 emulator-build: 7425822
script: ./gradlew $CI_GRADLE_ARG_PROPERTIES -Pandroid.testInstrumentationRunnerArguments.class='org.matrix.android.sdk.PermalinkParserTest' matrix-sdk-android:connectedDebugAndroidTest script: ./gradlew $CI_GRADLE_ARG_PROPERTIES -Pandroid.testInstrumentationRunnerArguments.class='org.matrix.android.sdk.PermalinkParserTest' matrix-sdk-android:connectedDebugAndroidTest
- name: Read Results [org.matrix.android.sd.PermalinkParserTest] - name: Read Results [org.matrix.android.sd.PermalinkParserTest]
continue-on-error: true if: always()
id: get-comment-body-permalink id: get-comment-body-permalink
run: | run: |
body="$(cat ./matrix-sdk-android/build/outputs/androidTest-results/connected/*.xml | grep "<testsuite" | sed "s@.*tests=\(.*\)time=.*@\1@")" body="$(cat ./matrix-sdk-android/build/outputs/androidTest-results/connected/*.xml | grep "<testsuite" | sed "s@.*tests=\(.*\)time=.*@\1@")"
echo "::set-output name=permalink::passed=$body" echo "::set-output name=permalink::passed=$body"
- name: Find Comment - name: Find Comment
if: github.event_name == 'pull_request' if: always() && github.event_name == 'pull_request'
uses: peter-evans/find-comment@v1 uses: peter-evans/find-comment@v1
id: fc id: fc
with: with:
@ -188,7 +187,7 @@ jobs:
comment-author: 'github-actions[bot]' comment-author: 'github-actions[bot]'
body-includes: Integration Tests Results body-includes: Integration Tests Results
- name: Publish results to PR - name: Publish results to PR
if: github.event_name == 'pull_request' if: always() && github.event_name == 'pull_request'
uses: peter-evans/create-or-update-comment@v1 uses: peter-evans/create-or-update-comment@v1
with: with:
comment-id: ${{ steps.fc.outputs.comment-id }} comment-id: ${{ steps.fc.outputs.comment-id }}