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 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 -PallWarningsAsErrors=false # 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 -PallWarningsAsErrors=false # 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 - 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 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 }}] continue-on-error: true 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] continue-on-error: true id: get-comment-body-session 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