forked from element-hq/element-x-android
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/develop' into develop
- Loading branch information
Showing
3,296 changed files
with
6,722 additions
and
6,618 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,16 @@ jobs: | |
path: | | ||
app/build/outputs/apk/gplay/debug/*-universal-debug.apk | ||
app/build/outputs/apk/fdroid/debug/*-universal-debug.apk | ||
- name: Upload x86_64 APK for Maestro | ||
if: ${{ matrix.variant == 'debug' }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: elementx-apk-maestro | ||
path: | | ||
app/build/outputs/apk/gplay/debug/app-gplay-x86_64-debug.apk | ||
retention-days: 5 | ||
overwrite: true | ||
if-no-files-found: error | ||
- uses: rnkdsh/[email protected] | ||
id: diawi | ||
# Do not fail the whole build if Diawi upload fails | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,39 @@ | ||
name: Maestro | ||
name: Maestro (local) | ||
|
||
# Run this flow only on pull request, and only when the pull request has the Run-Maestro label, to limit our usage of maestro cloud. | ||
# Run this flow only when APK Build workflow completes | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [labeled] | ||
workflow_run: | ||
workflows: [APK Build] | ||
types: | ||
- completed | ||
|
||
# Enrich gradle.properties for CI/CD | ||
env: | ||
GRADLE_OPTS: -Dorg.gradle.jvmargs=-Xmx9g -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError -XX:+UseG1GC -Dkotlin.daemon.jvm.options=-Xmx4g | ||
CI_GRADLE_ARG_PROPERTIES: --stacktrace --no-daemon -Dsonar.gradle.skipCompile=true --no-configuration-cache | ||
ARCH: x86_64 | ||
DEVICE: pixel_7_pro | ||
API_LEVEL: 35 | ||
TARGET: google_apis | ||
|
||
jobs: | ||
build-apk: | ||
name: Build APK | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'workflow_dispatch' || github.event.label.name == 'Run-Maestro' | ||
if: github.event_name == 'workflow_dispatch' | ||
# Allow one per PR. | ||
concurrency: | ||
group: ${{ format('maestro-{0}', github.ref) }} | ||
cancel-in-progress: true | ||
steps: | ||
- name: Remove Run-Maestro label | ||
if: ${{ github.event_name == 'pull_request' && github.event.label.name == 'Run-Maestro' }} | ||
uses: actions-ecosystem/action-remove-labels@v1 | ||
with: | ||
labels: Run-Maestro | ||
- uses: actions/checkout@v4 | ||
if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch' | ||
with: | ||
# Ensure we are building the branch and not the branch after being merged on develop | ||
# https://github.com/actions/checkout/issues/881 | ||
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} | ||
ref: ${{ github.ref }} | ||
- uses: actions/setup-java@v4 | ||
name: Use JDK 21 | ||
if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch' | ||
with: | ||
distribution: 'temurin' # See 'Supported distributions' for available options | ||
java-version: '21' | ||
|
@@ -44,7 +43,6 @@ jobs: | |
cache-read-only: ${{ github.ref != 'refs/heads/develop' }} | ||
- name: Assemble debug APK | ||
run: ./gradlew :app:assembleGplayDebug $CI_GRADLE_ARG_PROPERTIES | ||
if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch' | ||
env: | ||
ELEMENT_ANDROID_MAPTILER_API_KEY: ${{ secrets.MAPTILER_KEY }} | ||
ELEMENT_ANDROID_MAPTILER_LIGHT_MAP_ID: ${{ secrets.MAPTILER_LIGHT_MAP_ID }} | ||
|
@@ -62,8 +60,9 @@ jobs: | |
maestro-cloud: | ||
name: Maestro test suite | ||
runs-on: ubuntu-latest | ||
needs: build-apk | ||
if: github.event_name == 'workflow_dispatch' || github.event.label.name == 'Run-Maestro' | ||
needs: [build-apk] | ||
# Only if the APKs were built successfully. | ||
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' | ||
# Allow one per PR. | ||
concurrency: | ||
group: ${{ format('maestro-{0}', github.ref) }} | ||
|
@@ -74,23 +73,52 @@ jobs: | |
with: | ||
# Ensure we are building the branch and not the branch after being merged on develop | ||
# https://github.com/actions/checkout/issues/881 | ||
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} | ||
ref: ${{ github.ref }} | ||
- name: Download APK artifact from 'Build APKs' flow | ||
uses: actions/download-artifact@v4 | ||
if: github.event.workflow_run.conclusion == 'success' | ||
with: | ||
name: elementx-apk-maestro | ||
run-id: ${{ github.event.workflow_run.id }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Download APK artifact from previous job | ||
uses: actions/download-artifact@v4 | ||
if: github.event_name == 'workflow_dispatch' | ||
with: | ||
name: elementx-apk-maestro | ||
- uses: mobile-dev-inc/[email protected] | ||
if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch' | ||
- name: Enable KVM group perms | ||
run: | | ||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
sudo udevadm control --reload-rules | ||
sudo udevadm trigger --name-match=kvm | ||
- name: Install maestro | ||
run: curl -fsSL "https://get.maestro.mobile.dev" | bash | ||
- name: Run Maestro tests in emulator | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
env: | ||
MAESTRO_USERNAME: maestroelement | ||
MAESTRO_PASSWORD: ${{ secrets.MATRIX_MAESTRO_ACCOUNT_PASSWORD }} | ||
MAESTRO_RECOVERY_KEY: ${{ secrets.MATRIX_MAESTRO_ACCOUNT_RECOVERY_KEY }} | ||
MAESTRO_ROOM_NAME: MyRoom | ||
MAESTRO_INVITEE1_MXID: "@maestroelement2:matrix.org" | ||
MAESTRO_INVITEE2_MXID: "@maestroelement3:matrix.org" | ||
MAESTRO_APP_ID: io.element.android.x.debug | ||
with: | ||
api-level: ${{ env.API_LEVEL }} | ||
arch: ${{ env.ARCH }} | ||
profile: ${{ env.DEVICE }} | ||
target: ${{ env.TARGET }} | ||
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
disable-animations: true | ||
disk-size: 3G | ||
script: | | ||
.github/workflows/scripts/maestro/maestro-local-with-screen-recording.sh app-gplay-x86_64-debug.apk | ||
- name: Upload test results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }} | ||
# Doc says (https://github.com/mobile-dev-inc/action-maestro-cloud#android): | ||
# app-file should point to an x86 compatible APK file, so upload the x86_64 one (much smaller than the universal APK). | ||
app-file: app-gplay-x86_64-debug.apk | ||
env: | | ||
MAESTRO_USERNAME=maestroelement | ||
MAESTRO_PASSWORD=${{ secrets.MATRIX_MAESTRO_ACCOUNT_PASSWORD }} | ||
MAESTRO_RECOVERY_KEY=${{ secrets.MATRIX_MAESTRO_ACCOUNT_RECOVERY_KEY }} | ||
MAESTRO_ROOM_NAME=MyRoom | ||
MAESTRO_INVITEE1_MXID=@maestroelement2:matrix.org | ||
MAESTRO_INVITEE2_MXID=@maestroelement3:matrix.org | ||
MAESTRO_APP_ID=io.element.android.x.debug | ||
name: test-results | ||
path: | | ||
~/.maestro/tests/** | ||
retention-days: 5 | ||
overwrite: true | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
# | ||
# Copyright 2024 New Vector Ltd. | ||
# | ||
# SPDX-License-Identifier: AGPL-3.0-only | ||
# Please see LICENSE in the repository root for full details. | ||
# | ||
|
||
COUNT=0 | ||
mkdir -p /data/local/tmp/recordings; | ||
FILENAME=/data/local/tmp/recordings/testRecording$COUNT.mp4 | ||
while true | ||
do | ||
((COUNT++)) | ||
FILENAME=/data/local/tmp/recordings/testRecording$COUNT.mp4 | ||
echo "\nRecording video file #$COUNT" | ||
screenrecord --bugreport --bit-rate=16m --size 720x1280 $FILENAME | ||
done |
36 changes: 36 additions & 0 deletions
36
.github/workflows/scripts/maestro/maestro-local-with-screen-recording.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
|
||
# | ||
# Copyright 2024 New Vector Ltd. | ||
# | ||
# SPDX-License-Identifier: AGPL-3.0-only | ||
# Please see LICENSE in the repository root for full details. | ||
# | ||
|
||
adb install -r $1 | ||
set -x | ||
echo "Starting the screen recording..." | ||
adb push .github/workflows/scripts/maestro/local-recording.sh /data/local/tmp/ | ||
adb shell "chmod +x /data/local/tmp/local-recording.sh" | ||
adb shell "/data/local/tmp/local-recording.sh & echo \$! > /data/local/tmp/screenrecord_pid.txt" & | ||
set +e | ||
~/.maestro/bin/maestro test .maestro/allTests.yaml | ||
TEST_STATUS=$? | ||
echo "Test run completed with status $TEST_STATUS" | ||
|
||
# Stop the screen recording loop | ||
SCRIPT_PID=$(adb shell "cat /data/local/tmp/screenrecord_pid.txt") | ||
adb shell "kill -2 $SCRIPT_PID" | ||
|
||
# Get the PID of the screen recording process | ||
SCREENRECORD_PID=$(adb shell ps | grep screenrecord | awk '{print $2}') | ||
# Wait for the screen recording process to exit | ||
while [ ! -z $SCREENRECORD_PID ]; do | ||
echo "Waiting for screen recording ($SCREENRECORD_PID) to finish..." | ||
adb shell "kill -2 $SCREENRECORD_PID" | ||
sleep 1 | ||
SCREENRECORD_PID=$(adb shell ps | grep screenrecord | awk '{print $2}') | ||
done | ||
|
||
adb pull /data/local/tmp/recordings/ ~/.maestro/tests/ | ||
exit $TEST_STATUS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Licensees holding a valid commercial license with Element may use this | ||
software in accordance with the terms contained in a written agreement | ||
between you and Element. | ||
|
||
To purchase a commercial license please contact our sales team at | ||
[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
anvilannotations/src/main/kotlin/io/element/android/anvilannotations/ContributesNode.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
anvilcodegen/src/main/kotlin/io/element/android/anvilcodegen/ContributesNodeProcessor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...degen/src/main/kotlin/io/element/android/anvilcodegen/ContributesNodeProcessorProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
app/src/main/kotlin/io/element/android/x/ElementXApplication.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.