2022-05-09 16:49:34 +03: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 02:04:41 +03:00
|
|
|
|
|
|
|
on:
|
2022-05-09 17:12:29 +03:00
|
|
|
pull_request:
|
2022-05-09 16:49:34 +03:00
|
|
|
types: [closed]
|
|
|
|
branches: [develop]
|
2022-01-04 02:04:41 +03:00
|
|
|
|
|
|
|
# Enrich gradle.properties for CI/CD
|
|
|
|
env:
|
2022-08-04 12:00:47 +03:00
|
|
|
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false
|
2022-08-03 17:53:27 +03:00
|
|
|
CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 2 --no-daemon
|
2022-05-09 16:49:34 +03:00
|
|
|
|
2022-01-04 02:04:41 +03:00
|
|
|
jobs:
|
2022-05-09 16:49:34 +03:00
|
|
|
|
|
|
|
# More info on should-i-run:
|
2022-11-24 11:46:11 +03: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 16:49:34 +03: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 17:46:07 +03:00
|
|
|
if: github.event.pull_request.merged # Additionally require PR to have been completely merged.
|
2022-05-09 16:49:34 +03:00
|
|
|
steps:
|
|
|
|
- run: echo "Run those tests!" # no-op success
|
2022-11-24 11:46:11 +03:00
|
|
|
|
2022-02-25 17:18:56 +03:00
|
|
|
ui-tests:
|
|
|
|
name: UI Tests (Synapse)
|
2022-05-09 16:49:34 +03:00
|
|
|
needs: should-i-run
|
2022-09-19 15:31:35 +03:00
|
|
|
runs-on: buildjet-4vcpu-ubuntu-2204
|
2022-11-24 11:46:11 +03:00
|
|
|
timeout-minutes: 90 # We might need to increase it if the time for tests grows
|
2022-02-25 17:18:56 +03:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
api-level: [ 28 ]
|
2022-02-28 15:29:52 +03:00
|
|
|
# No concurrency required, runs every time on a schedule.
|
2022-02-25 17:18:56 +03:00
|
|
|
steps:
|
2024-07-15 19:12:08 +03:00
|
|
|
- uses: actions/checkout@v4
|
2022-02-25 17:18:56 +03:00
|
|
|
- name: Set up Python 3.8
|
2022-06-14 02:05:19 +03:00
|
|
|
uses: actions/setup-python@v4
|
2022-02-25 17:18:56 +03:00
|
|
|
with:
|
|
|
|
python-version: 3.8
|
2024-10-25 11:29:16 +03:00
|
|
|
- name: Use JDK 21
|
2024-07-15 19:12:08 +03:00
|
|
|
uses: actions/setup-java@v4
|
2023-01-19 14:20:16 +03:00
|
|
|
with:
|
2024-07-15 19:12:08 +03:00
|
|
|
distribution: 'temurin' # See 'Supported distributions' for available options
|
2024-10-25 11:29:16 +03:00
|
|
|
java-version: '21'
|
2023-01-19 14:20:16 +03:00
|
|
|
- name: Configure gradle
|
2024-07-15 19:12:08 +03:00
|
|
|
uses: gradle/actions/setup-gradle@v3
|
2022-02-25 17:18:56 +03:00
|
|
|
with:
|
2023-01-19 14:20:16 +03:00
|
|
|
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
|
2022-02-25 17:18:56 +03:00
|
|
|
- name: Start synapse server
|
2022-10-18 02:04:02 +03:00
|
|
|
uses: michaelkaye/setup-matrix-synapse@v1.0.4
|
2022-03-09 21:26:37 +03:00
|
|
|
with:
|
|
|
|
uploadLogs: true
|
|
|
|
httpPort: 8080
|
|
|
|
disableRateLimiting: true
|
2022-05-05 16:35:54 +03:00
|
|
|
public_baseurl: "http://10.0.2.2:8080/"
|
2022-02-25 17:18:56 +03: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 16:26:04 +03: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 17:18:56 +03:00
|
|
|
- name: Upload Test Report Log
|
2022-04-12 02:08:54 +03:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-02-25 17:18:56 +03:00
|
|
|
if: always()
|
|
|
|
with:
|
2022-02-28 20:06:34 +03:00
|
|
|
name: uitest-error-results
|
2022-02-25 17:18:56 +03:00
|
|
|
path: |
|
|
|
|
emulator.log
|
|
|
|
failure_screenshots/
|
|
|
|
|
2022-05-09 16:49:34 +03:00
|
|
|
# Notify the channel about delayed failures
|
2022-02-25 17:18:56 +03:00
|
|
|
notify:
|
2022-03-09 13:21:29 +03:00
|
|
|
name: Notify matrix
|
2022-02-25 17:18:56 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs:
|
2022-05-09 16:49:34 +03:00
|
|
|
- should-i-run
|
2022-02-28 15:29:52 +03:00
|
|
|
- ui-tests
|
2022-10-18 11:00:18 +03:00
|
|
|
if: always() && (needs.should-i-run.result == 'success' ) && (needs.ui-tests.result != 'success')
|
2022-02-28 15:29:52 +03:00
|
|
|
# No concurrency required, runs every time on a schedule.
|
2022-02-25 17:18:56 +03:00
|
|
|
steps:
|
2022-03-30 18:46:44 +03:00
|
|
|
- uses: michaelkaye/matrix-hookshot-action@v1.0.0
|
2022-02-28 15:29:52 +03:00
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
2022-03-30 18:46:44 +03:00
|
|
|
hookshot_url: ${{ secrets.ELEMENT_ANDROID_HOOKSHOT_URL }}
|
2022-05-17 19:40:42 +03: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}}"
|