2021-09-01 22:42:08 +08:00
|
|
|
name: Sanity Test
|
|
|
|
|
|
|
|
on:
|
2021-11-08 23:11:25 +08:00
|
|
|
schedule:
|
|
|
|
# At 20:00 every day UTC
|
|
|
|
- cron: '0 20 * * *'
|
2021-09-01 22:42:08 +08:00
|
|
|
|
2021-09-08 19:03:51 +08:00
|
|
|
# Enrich gradle.properties for CI/CD
|
|
|
|
env:
|
|
|
|
CI_GRADLE_ARG_PROPERTIES: >
|
|
|
|
-Porg.gradle.jvmargs=-Xmx2g
|
|
|
|
-Porg.gradle.parallel=false
|
|
|
|
|
2021-09-01 22:42:08 +08:00
|
|
|
jobs:
|
|
|
|
integration-tests:
|
|
|
|
name: Sanity Tests (Synapse)
|
2021-11-08 23:14:18 +08:00
|
|
|
runs-on: macos-latest
|
2021-09-01 22:42:08 +08:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2021-11-10 02:33:57 +08:00
|
|
|
api-level: [ 29 ]
|
2021-09-01 22:42:08 +08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-11-08 23:11:25 +08:00
|
|
|
with:
|
|
|
|
ref: develop
|
2021-09-01 22:42:08 +08:00
|
|
|
- name: Set up Python 3.8
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: 3.8
|
|
|
|
- name: Cache pip
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
|
|
|
key: ${{ runner.os }}-pip
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
${{ runner.os }}-
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-gradle-
|
|
|
|
- name: Start synapse server
|
|
|
|
run: |
|
|
|
|
python3 -m venv .synapse
|
|
|
|
source .synapse/bin/activate
|
|
|
|
pip install synapse matrix-synapse
|
2021-11-08 23:18:29 +08:00
|
|
|
curl -sL https://raw.githubusercontent.com/matrix-org/synapse/develop/demo/start.sh \
|
|
|
|
| sed s/127.0.0.1/0.0.0.0/g | sed 's/http:\/\/localhost/http:\/\/10.0.2.2/g' | bash -s -- --no-rate-limit
|
2021-11-08 23:14:18 +08:00
|
|
|
- uses: actions/setup-java@v2
|
|
|
|
with:
|
|
|
|
distribution: 'adopt'
|
|
|
|
java-version: '11'
|
2021-09-01 22:42:08 +08:00
|
|
|
- name: Run sanity tests on API ${{ matrix.api-level }}
|
|
|
|
uses: reactivecircus/android-emulator-runner@v2
|
2021-11-10 02:33:57 +08:00
|
|
|
continue-on-error: true # allow pipeline to upload failure results
|
2021-09-01 22:42:08 +08:00
|
|
|
with:
|
2021-11-09 19:33:48 +08:00
|
|
|
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
2021-09-01 22:42:08 +08:00
|
|
|
api-level: ${{ matrix.api-level }}
|
2021-11-10 02:33:57 +08:00
|
|
|
emulator-build: 7425822 # workaround to emulator bug: https://github.com/ReactiveCircus/android-emulator-runner/issues/160
|
2021-11-10 01:44:49 +08:00
|
|
|
script: |
|
|
|
|
adb root
|
2021-11-10 02:33:57 +08:00
|
|
|
adb logcat -c
|
|
|
|
touch emulator.log
|
|
|
|
chmod 777 emulator.log
|
|
|
|
adb logcat >> emulator.log &
|
2021-11-10 01:44:49 +08:00
|
|
|
./gradlew $CI_GRADLE_ARG_PROPERTIES -PallWarningsAsErrors=false connectedGplayDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=im.vector.app.ui.UiAllScreensSanityTest || adb pull storage/emulated/0/Pictures/failure_screenshots
|
2021-09-01 22:42:08 +08:00
|
|
|
|
2021-11-10 02:33:57 +08:00
|
|
|
- name: Upload Failing Test Report Log
|
|
|
|
if: failure()
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: sanity-error-results
|
|
|
|
path: |
|
|
|
|
emulator.log
|
|
|
|
failure_screenshots/
|