2022-05-09 15:49:34 +02:00
|
|
|
name: Integration Tests
|
|
|
|
|
|
|
|
# This runs for all closed pull requests against main, including those closed without merge.
|
|
|
|
# Further filtering occurs in 'should-i-run'
|
2022-01-04 00:04:41 +01:00
|
|
|
|
|
|
|
on:
|
2022-05-09 16:12:29 +02:00
|
|
|
pull_request:
|
2022-05-09 15:49:34 +02:00
|
|
|
types: [closed]
|
|
|
|
branches: [develop]
|
2022-01-04 00:04:41 +01:00
|
|
|
|
|
|
|
# Enrich gradle.properties for CI/CD
|
|
|
|
env:
|
2022-08-04 11:00:47 +02:00
|
|
|
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false
|
2022-08-03 16:53:27 +02:00
|
|
|
CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 2 --no-daemon
|
2022-05-09 15:49:34 +02:00
|
|
|
|
2022-01-04 00:04:41 +01:00
|
|
|
jobs:
|
2022-05-09 15:49:34 +02:00
|
|
|
|
|
|
|
# More info on should-i-run:
|
2022-11-24 09:46:11 +01:00
|
|
|
# If this fails to run (the IF doesn't complete) then the needs will not be satisfied for any of the
|
2022-05-09 15:49:34 +02:00
|
|
|
# other jobs below, so none will run.
|
|
|
|
# except for the notification job at the bottom which will run all the time, unless should-i-run isn't
|
|
|
|
# successful, or all the other jobs have succeeded
|
|
|
|
|
|
|
|
should-i-run:
|
|
|
|
name: Check if PR is suitable for analysis
|
|
|
|
runs-on: ubuntu-latest
|
2022-05-09 16:46:07 +02:00
|
|
|
if: github.event.pull_request.merged # Additionally require PR to have been completely merged.
|
2022-05-09 15:49:34 +02:00
|
|
|
steps:
|
|
|
|
- run: echo "Run those tests!" # no-op success
|
2022-11-24 09:46:11 +01:00
|
|
|
|
2022-02-25 15:18:56 +01:00
|
|
|
ui-tests:
|
|
|
|
name: UI Tests (Synapse)
|
2022-05-09 15:49:34 +02:00
|
|
|
needs: should-i-run
|
2022-09-19 14:31:35 +02:00
|
|
|
runs-on: buildjet-4vcpu-ubuntu-2204
|
2022-11-24 09:46:11 +01:00
|
|
|
timeout-minutes: 90 # We might need to increase it if the time for tests grows
|
2022-02-25 15:18:56 +01:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
api-level: [ 28 ]
|
2022-02-28 13:29:52 +01:00
|
|
|
# No concurrency required, runs every time on a schedule.
|
2022-02-25 15:18:56 +01:00
|
|
|
steps:
|
2022-03-08 00:05:24 +01:00
|
|
|
- uses: actions/checkout@v3
|
2022-02-25 15:18:56 +01:00
|
|
|
- name: Set up Python 3.8
|
2022-06-14 01:05:19 +02:00
|
|
|
uses: actions/setup-python@v4
|
2022-02-25 15:18:56 +01:00
|
|
|
with:
|
|
|
|
python-version: 3.8
|
2023-01-19 12:20:16 +01:00
|
|
|
- uses: actions/setup-java@v3
|
|
|
|
with:
|
|
|
|
distribution: 'adopt'
|
|
|
|
java-version: '11'
|
|
|
|
- name: Configure gradle
|
|
|
|
uses: gradle/gradle-build-action@v2
|
2022-02-25 15:18:56 +01:00
|
|
|
with:
|
2023-01-19 12:20:16 +01:00
|
|
|
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
|
2022-02-25 15:18:56 +01:00
|
|
|
- name: Start synapse server
|
2022-10-18 01:04:02 +02:00
|
|
|
uses: michaelkaye/setup-matrix-synapse@v1.0.4
|
2022-03-09 19:26:37 +01:00
|
|
|
with:
|
|
|
|
uploadLogs: true
|
|
|
|
httpPort: 8080
|
|
|
|
disableRateLimiting: true
|
2022-05-05 15:35:54 +02:00
|
|
|
public_baseurl: "http://10.0.2.2:8080/"
|
2022-02-25 15:18:56 +01:00
|
|
|
- name: Run sanity tests on API ${{ matrix.api-level }}
|
|
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
|
|
with:
|
|
|
|
api-level: ${{ matrix.api-level }}
|
|
|
|
arch: x86
|
|
|
|
profile: Nexus 5X
|
|
|
|
force-avd-creation: false
|
|
|
|
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
|
|
|
emulator-build: 7425822 # workaround to emulator bug: https://github.com/ReactiveCircus/android-emulator-runner/issues/160
|
|
|
|
script: |
|
|
|
|
adb root
|
|
|
|
adb logcat -c
|
|
|
|
touch emulator.log
|
|
|
|
chmod 777 emulator.log
|
|
|
|
adb logcat >> emulator.log &
|
2022-03-08 14:26:04 +01:00
|
|
|
./gradlew $CI_GRADLE_ARG_PROPERTIES connectedGplayDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=im.vector.app.ui.UiAllScreensSanityTest || (adb pull storage/emulated/0/Pictures/failure_screenshots && exit 1 )
|
2022-02-25 15:18:56 +01:00
|
|
|
- name: Upload Test Report Log
|
2022-04-12 01:08:54 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-02-25 15:18:56 +01:00
|
|
|
if: always()
|
|
|
|
with:
|
2022-02-28 18:06:34 +01:00
|
|
|
name: uitest-error-results
|
2022-02-25 15:18:56 +01:00
|
|
|
path: |
|
|
|
|
emulator.log
|
|
|
|
failure_screenshots/
|
|
|
|
|
2022-05-09 15:49:34 +02:00
|
|
|
# Notify the channel about delayed failures
|
2022-02-25 15:18:56 +01:00
|
|
|
notify:
|
2022-03-09 11:21:29 +01:00
|
|
|
name: Notify matrix
|
2022-02-25 15:18:56 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs:
|
2022-05-09 15:49:34 +02:00
|
|
|
- should-i-run
|
2022-02-28 13:29:52 +01:00
|
|
|
- ui-tests
|
2022-10-18 10:00:18 +02:00
|
|
|
if: always() && (needs.should-i-run.result == 'success' ) && (needs.ui-tests.result != 'success')
|
2022-02-28 13:29:52 +01:00
|
|
|
# No concurrency required, runs every time on a schedule.
|
2022-02-25 15:18:56 +01:00
|
|
|
steps:
|
2022-03-30 17:46:44 +02:00
|
|
|
- uses: michaelkaye/matrix-hookshot-action@v1.0.0
|
2022-02-28 13:29:52 +01:00
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
2022-03-30 17:46:44 +02:00
|
|
|
hookshot_url: ${{ secrets.ELEMENT_ANDROID_HOOKSHOT_URL }}
|
2022-05-17 18:40:42 +02:00
|
|
|
text_template: "Post-merge validation of ${{ github.head_ref }} into ${{ github.base_ref }} by ${{ github.event.pull_request.merged_by.login }} failed: {{#each job_statuses }}{{#with this }}{{#if completed }} {{name}} {{conclusion}} at {{completed_at}}, {{/if}}{{/with}}{{/each}}"
|
|
|
|
html_template: "Post-merge validation of ${{ github.head_ref }} into ${{ github.base_ref }} by ${{ github.event.pull_request.merged_by.login }} failed: {{#each job_statuses }}{{#with this }}{{#if completed }}<br />{{icon conclusion}} {{name}} <font color='{{color conclusion}}'>{{conclusion}} at {{completed_at}} <a href=\"{{html_url}}\">[details]</a></font>{{/if}}{{/with}}{{/each}}"
|