Skip to content

Commit c87cc4c

Browse files
committed
Merge branch 'release/25.02.0' into main
2 parents bdc1b75 + 9b341c5 commit c87cc4c

File tree

4,353 files changed

+21002
-11758
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,353 files changed

+21002
-11758
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,10 @@ Uncomment this markdown table below and edit the last line `|||`:
4444

4545
<!-- Depending on the Pull Request content, it can be acceptable if some of the following checkboxes stay unchecked. -->
4646

47-
- [ ] Changes have been tested on an Android device or Android emulator with API 23
47+
- [ ] Changes have been tested on an Android device or Android emulator with API 24
4848
- [ ] UI change has been tested on both light and dark themes
4949
- [ ] Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
5050
- [ ] Pull request is based on the develop branch
5151
- [ ] Pull request title will be used in the release note, it clearly define what will change for the user
5252
- [ ] Pull request includes screenshots or videos if containing UI changes
53-
- [ ] Pull request includes a [sign off](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#sign-off)
5453
- [ ] You've made a self review of your PR

.github/workflows/build.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313
CI_GRADLE_ARG_PROPERTIES: --stacktrace -Dsonar.gradle.skipCompile=true --no-configuration-cache
1414

1515
jobs:
16-
debug:
16+
build:
1717
name: Build APKs
1818
runs-on: ubuntu-latest
1919
strategy:
@@ -45,6 +45,7 @@ jobs:
4545
ELEMENT_ANDROID_MAPTILER_API_KEY: ${{ secrets.MAPTILER_KEY }}
4646
ELEMENT_ANDROID_MAPTILER_LIGHT_MAP_ID: ${{ secrets.MAPTILER_LIGHT_MAP_ID }}
4747
ELEMENT_ANDROID_MAPTILER_DARK_MAP_ID: ${{ secrets.MAPTILER_DARK_MAP_ID }}
48+
ELEMENT_ANDROID_SENTRY_DSN: ${{ secrets.ELEMENT_ANDROID_SENTRY_DSN }}
4849
run: ./gradlew :app:assembleGplayDebug app:assembleFDroidDebug -PallWarningsAsErrors=true $CI_GRADLE_ARG_PROPERTIES
4950
- name: Upload debug APKs
5051
if: ${{ matrix.variant == 'debug' }}
@@ -54,7 +55,17 @@ jobs:
5455
path: |
5556
app/build/outputs/apk/gplay/debug/*-universal-debug.apk
5657
app/build/outputs/apk/fdroid/debug/*-universal-debug.apk
57-
- uses: rnkdsh/[email protected]
58+
- name: Upload x86_64 APK for Maestro
59+
if: ${{ matrix.variant == 'debug' }}
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: elementx-apk-maestro
63+
path: |
64+
app/build/outputs/apk/gplay/debug/app-gplay-x86_64-debug.apk
65+
retention-days: 5
66+
overwrite: true
67+
if-no-files-found: error
68+
- uses: rnkdsh/[email protected]
5869
id: diawi
5970
# Do not fail the whole build if Diawi upload fails
6071
continue-on-error: true

.github/workflows/build_enterprise.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
ELEMENT_ANDROID_MAPTILER_API_KEY: ${{ secrets.MAPTILER_KEY }}
5454
ELEMENT_ANDROID_MAPTILER_LIGHT_MAP_ID: ${{ secrets.MAPTILER_LIGHT_MAP_ID }}
5555
ELEMENT_ANDROID_MAPTILER_DARK_MAP_ID: ${{ secrets.MAPTILER_DARK_MAP_ID }}
56+
ELEMENT_ANDROID_SENTRY_DSN: ${{ secrets.ELEMENT_ANDROID_SENTRY_DSN }}
5657
run: ./gradlew :app:assembleGplayDebug -PallWarningsAsErrors=true $CI_GRADLE_ARG_PROPERTIES
5758
- name: Upload debug Enterprise APKs
5859
if: ${{ matrix.variant == 'debug' }}
Lines changed: 45 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,35 @@
1-
name: Maestro
1+
name: Maestro (local)
22

3-
# 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.
3+
# Run this flow only when APK Build workflow completes
44
on:
55
workflow_dispatch:
66
pull_request:
7-
types: [labeled]
87

98
# Enrich gradle.properties for CI/CD
109
env:
1110
GRADLE_OPTS: -Dorg.gradle.jvmargs=-Xmx9g -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError -XX:+UseG1GC -Dkotlin.daemon.jvm.options=-Xmx4g
1211
CI_GRADLE_ARG_PROPERTIES: --stacktrace --no-daemon -Dsonar.gradle.skipCompile=true --no-configuration-cache
12+
ARCH: x86_64
13+
DEVICE: pixel_7_pro
14+
API_LEVEL: 35
15+
TARGET: google_apis
1316

1417
jobs:
1518
build-apk:
1619
name: Build APK
1720
runs-on: ubuntu-latest
18-
if: github.event_name == 'workflow_dispatch' || github.event.label.name == 'Run-Maestro'
1921
# Allow one per PR.
2022
concurrency:
2123
group: ${{ format('maestro-{0}', github.ref) }}
2224
cancel-in-progress: true
2325
steps:
24-
- name: Remove Run-Maestro label
25-
if: ${{ github.event_name == 'pull_request' && github.event.label.name == 'Run-Maestro' }}
26-
uses: actions-ecosystem/action-remove-labels@v1
27-
with:
28-
labels: Run-Maestro
2926
- uses: actions/checkout@v4
30-
if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch'
3127
with:
3228
# Ensure we are building the branch and not the branch after being merged on develop
3329
# https://github.com/actions/checkout/issues/881
34-
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
30+
ref: ${{ github.ref }}
3531
- uses: actions/setup-java@v4
3632
name: Use JDK 21
37-
if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch'
3833
with:
3934
distribution: 'temurin' # See 'Supported distributions' for available options
4035
java-version: '21'
@@ -44,7 +39,6 @@ jobs:
4439
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
4540
- name: Assemble debug APK
4641
run: ./gradlew :app:assembleGplayDebug $CI_GRADLE_ARG_PROPERTIES
47-
if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch'
4842
env:
4943
ELEMENT_ANDROID_MAPTILER_API_KEY: ${{ secrets.MAPTILER_KEY }}
5044
ELEMENT_ANDROID_MAPTILER_LIGHT_MAP_ID: ${{ secrets.MAPTILER_LIGHT_MAP_ID }}
@@ -62,8 +56,7 @@ jobs:
6256
maestro-cloud:
6357
name: Maestro test suite
6458
runs-on: ubuntu-latest
65-
needs: build-apk
66-
if: github.event_name == 'workflow_dispatch' || github.event.label.name == 'Run-Maestro'
59+
needs: [build-apk]
6760
# Allow one per PR.
6861
concurrency:
6962
group: ${{ format('maestro-{0}', github.ref) }}
@@ -74,23 +67,45 @@ jobs:
7467
with:
7568
# Ensure we are building the branch and not the branch after being merged on develop
7669
# https://github.com/actions/checkout/issues/881
77-
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
70+
ref: ${{ github.ref }}
7871
- name: Download APK artifact from previous job
7972
uses: actions/download-artifact@v4
8073
with:
8174
name: elementx-apk-maestro
82-
- uses: mobile-dev-inc/[email protected]
83-
if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch'
75+
- name: Enable KVM group perms
76+
run: |
77+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
78+
sudo udevadm control --reload-rules
79+
sudo udevadm trigger --name-match=kvm
80+
- name: Install maestro
81+
run: curl -fsSL "https://get.maestro.mobile.dev" | bash
82+
- name: Run Maestro tests in emulator
83+
uses: reactivecircus/android-emulator-runner@v2
84+
continue-on-error: true
85+
env:
86+
MAESTRO_USERNAME: maestroelement
87+
MAESTRO_PASSWORD: ${{ secrets.MATRIX_MAESTRO_ACCOUNT_PASSWORD }}
88+
MAESTRO_RECOVERY_KEY: ${{ secrets.MATRIX_MAESTRO_ACCOUNT_RECOVERY_KEY }}
89+
MAESTRO_ROOM_NAME: MyRoom
90+
MAESTRO_INVITEE1_MXID: "@maestroelement2:matrix.org"
91+
MAESTRO_INVITEE2_MXID: "@maestroelement3:matrix.org"
92+
MAESTRO_APP_ID: io.element.android.x.debug
8493
with:
85-
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
86-
# Doc says (https://github.com/mobile-dev-inc/action-maestro-cloud#android):
87-
# app-file should point to an x86 compatible APK file, so upload the x86_64 one (much smaller than the universal APK).
88-
app-file: app-gplay-x86_64-debug.apk
89-
env: |
90-
MAESTRO_USERNAME=maestroelement
91-
MAESTRO_PASSWORD=${{ secrets.MATRIX_MAESTRO_ACCOUNT_PASSWORD }}
92-
MAESTRO_RECOVERY_KEY=${{ secrets.MATRIX_MAESTRO_ACCOUNT_RECOVERY_KEY }}
93-
MAESTRO_ROOM_NAME=MyRoom
94-
MAESTRO_INVITEE1_MXID=@maestroelement2:matrix.org
95-
MAESTRO_INVITEE2_MXID=@maestroelement3:matrix.org
96-
MAESTRO_APP_ID=io.element.android.x.debug
94+
api-level: ${{ env.API_LEVEL }}
95+
arch: ${{ env.ARCH }}
96+
profile: ${{ env.DEVICE }}
97+
target: ${{ env.TARGET }}
98+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
99+
disable-animations: true
100+
disk-size: 3G
101+
script: |
102+
.github/workflows/scripts/maestro/maestro-local-with-screen-recording.sh app-gplay-x86_64-debug.apk
103+
- name: Upload test results
104+
uses: actions/upload-artifact@v4
105+
with:
106+
name: test-results
107+
path: |
108+
~/.maestro/tests/**
109+
retention-days: 5
110+
overwrite: true
111+
if-no-files-found: error

.github/workflows/nightly.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
ELEMENT_ANDROID_MAPTILER_API_KEY: ${{ secrets.MAPTILER_KEY }}
3030
ELEMENT_ANDROID_MAPTILER_LIGHT_MAP_ID: ${{ secrets.MAPTILER_LIGHT_MAP_ID }}
3131
ELEMENT_ANDROID_MAPTILER_DARK_MAP_ID: ${{ secrets.MAPTILER_DARK_MAP_ID }}
32+
ELEMENT_ANDROID_SENTRY_DSN: ${{ secrets.ELEMENT_ANDROID_SENTRY_DSN }}
3233
ELEMENT_ANDROID_NIGHTLY_KEYID: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_KEYID }}
3334
ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD }}
3435
ELEMENT_ANDROID_NIGHTLY_STOREPASSWORD: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_STOREPASSWORD }}

.github/workflows/nightly_enterprise.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
ELEMENT_ANDROID_MAPTILER_API_KEY: ${{ secrets.MAPTILER_KEY }}
3636
ELEMENT_ANDROID_MAPTILER_LIGHT_MAP_ID: ${{ secrets.MAPTILER_LIGHT_MAP_ID }}
3737
ELEMENT_ANDROID_MAPTILER_DARK_MAP_ID: ${{ secrets.MAPTILER_DARK_MAP_ID }}
38+
ELEMENT_ANDROID_SENTRY_DSN: ${{ secrets.ELEMENT_ANDROID_SENTRY_DSN }}
3839
ELEMENT_ANDROID_NIGHTLY_KEYID: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_KEYID }}
3940
ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD }}
4041
ELEMENT_ANDROID_NIGHTLY_STOREPASSWORD: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_STOREPASSWORD }}

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
ELEMENT_ANDROID_MAPTILER_API_KEY: ${{ secrets.MAPTILER_KEY }}
3232
ELEMENT_ANDROID_MAPTILER_LIGHT_MAP_ID: ${{ secrets.MAPTILER_LIGHT_MAP_ID }}
3333
ELEMENT_ANDROID_MAPTILER_DARK_MAP_ID: ${{ secrets.MAPTILER_DARK_MAP_ID }}
34+
ELEMENT_ANDROID_SENTRY_DSN: ${{ secrets.ELEMENT_ANDROID_SENTRY_DSN }}
3435
run: ./gradlew bundleGplayRelease $CI_GRADLE_ARG_PROPERTIES
3536
- name: Upload bundle as artifact
3637
uses: actions/upload-artifact@v4
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
3+
#
4+
# Copyright 2024 New Vector Ltd.
5+
#
6+
# SPDX-License-Identifier: AGPL-3.0-only
7+
# Please see LICENSE in the repository root for full details.
8+
#
9+
10+
COUNT=0
11+
mkdir -p /data/local/tmp/recordings;
12+
FILENAME=/data/local/tmp/recordings/testRecording$COUNT.mp4
13+
while true
14+
do
15+
((COUNT++))
16+
FILENAME=/data/local/tmp/recordings/testRecording$COUNT.mp4
17+
echo "\nRecording video file #$COUNT"
18+
screenrecord --bugreport --bit-rate=16m --size 720x1280 $FILENAME
19+
done
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/sh
2+
3+
#
4+
# Copyright 2024 New Vector Ltd.
5+
#
6+
# SPDX-License-Identifier: AGPL-3.0-only
7+
# Please see LICENSE in the repository root for full details.
8+
#
9+
10+
adb install -r $1
11+
echo "Starting the screen recording..."
12+
adb push .github/workflows/scripts/maestro/local-recording.sh /data/local/tmp/
13+
adb shell "chmod +x /data/local/tmp/local-recording.sh"
14+
adb shell "/data/local/tmp/local-recording.sh & echo \$! > /data/local/tmp/screenrecord_pid.txt" &
15+
set +e
16+
~/.maestro/bin/maestro test .maestro/allTests.yaml
17+
TEST_STATUS=$?
18+
echo "Test run completed with status $TEST_STATUS"
19+
20+
# Stop the screen recording loop
21+
SCRIPT_PID=$(adb shell "cat /data/local/tmp/screenrecord_pid.txt")
22+
adb shell "kill -2 $SCRIPT_PID"
23+
24+
# Get the PID of the screen recording process
25+
SCREENRECORD_PID=$(adb shell ps | grep screenrecord | awk '{print $2}')
26+
# Wait for the screen recording process to exit
27+
while [ ! -z $SCREENRECORD_PID ]; do
28+
echo "Waiting for screen recording ($SCREENRECORD_PID) to finish..."
29+
adb shell "kill -2 $SCREENRECORD_PID"
30+
sleep 1
31+
SCREENRECORD_PID=$(adb shell ps | grep screenrecord | awk '{print $2}')
32+
done
33+
34+
adb pull /data/local/tmp/recordings/ ~/.maestro/tests/
35+
exit $TEST_STATUS

.github/workflows/scripts/recordScreenshots.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
# Copyright 2023-2024 New Vector Ltd.
44
#
5-
# SPDX-License-Identifier: AGPL-3.0-only
6-
# Please see LICENSE in the repository root for full details.
5+
# SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
6+
# Please see LICENSE files in the repository root for full details.
77

88
set -e
99

0 commit comments

Comments
 (0)