name: Integration Tests on: pull_request: { } push: branches: [ main, develop ] # Enrich gradle.properties for CI/CD env: CI_GRADLE_ARG_PROPERTIES: > -Porg.gradle.jvmargs=-Xmx2g -Porg.gradle.parallel=false -PallWarningsAsErrors=false jobs: # Build Android Tests [Matrix SDK] build-android-test-matrix-sdk: name: Matrix SDK - Build Android Tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - 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: Build Android Tests for matrix-sdk-android run: ./gradlew clean matrix-sdk-android:assembleAndroidTest $CI_GRADLE_ARG_PROPERTIES --stacktrace # Build Android Tests [Matrix APP] build-android-test-app: name: App - Build Android Tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - 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: Build Android Tests for vector run: ./gradlew clean vector:assembleAndroidTest $CI_GRADLE_ARG_PROPERTIES --stacktrace # Run Android Tests integration-tests: name: Matrix SDK - Running Integration Tests runs-on: ubuntu-latest strategy: fail-fast: false matrix: api-level: [ 28 ] steps: - uses: actions/checkout@v2 - uses: gradle/wrapper-validation-action@v1 - uses: actions/setup-java@v2 with: distribution: 'adopt' java-version: 11 - name: Set up Python 3.8 uses: actions/setup-python@v2 with: python-version: 3.8 - 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: | pip install matrix-synapse curl https://raw.githubusercontent.com/matrix-org/synapse/develop/demo/start.sh -o start.sh chmod 777 start.sh ./start.sh --no-rate-limit # package: org.matrix.android.sdk.session - name: Run integration tests for Matrix SDK [org.matrix.android.sdk.session] 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 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] if: always() id: get-comment-body-session run: python3 tools/ci/render_xml_output.py session ./matrix-sdk-android/build/outputs/androidTest-results/connected/*.xml - name: Run integration tests for Matrix SDK [org.matrix.android.sdk.account] API[${{ matrix.api-level }}] if: always() 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 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] if: always() id: get-comment-body-account run: python3 tools/ci/render_xml_output.py account ./matrix-sdk-android/build/outputs/androidTest-results/connected/*.xml # package: org.matrix.android.sdk.internal - name: Run integration tests for Matrix SDK [org.matrix.android.sdk.internal] API[${{ matrix.api-level }}] if: always() 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 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] if: always() id: get-comment-body-internal run: python3 tools/ci/render_xml_output.py internal ./matrix-sdk-android/build/outputs/androidTest-results/connected/*.xml # package: org.matrix.android.sdk.ordering - name: Run integration tests for Matrix SDK [org.matrix.android.sdk.ordering] API[${{ matrix.api-level }}] if: always() 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 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] if: always() id: get-comment-body-ordering run: | body="$(cat ./matrix-sdk-android/build/outputs/androidTest-results/connected/*.xml | grep "${{ steps.get-comment-body-session.outputs.session }} - `[org.matrix.android.sdk.account]`
${{ steps.get-comment-body-account.outputs.account }} - `[org.matrix.android.sdk.internal]`
${{ steps.get-comment-body-internal.outputs.internal }} - `[org.matrix.android.sdk.ordering]`
${{ steps.get-comment-body-ordering.outputs.ordering }} - `[org.matrix.android.sdk.PermalinkParserTest]`
${{ steps.get-comment-body-permalink.outputs.permalink }} edit-mode: replace ## Useful commands # script: ./integration_tests_script.sh # script: ./gradlew $CI_GRADLE_ARG_PROPERTIES -Pandroid.testInstrumentationRunnerArguments.package='org.matrix.android.sdk.session' matrix-sdk-android:connectedDebugAndroidTest --info # script: ./gradlew $CI_GRADLE_ARG_PROPERTIES matrix-sdk-android:connectedAndroidTest --info # script: ./gradlew $CI_GRADLE_ARG_PROPERTIES -PallWarningsAsErrors=false connectedCheck --stacktrace # script: ./gradlew $CI_GRADLE_ARG_PROPERTIES -Pandroid.testInstrumentationRunnerArguments.class=org.matrix.android.sdk.session.room.timeline.ChunkEntityTest matrix-sdk-android:connectedAndroidTest --info