Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,18 @@ jobs:
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
fail-fast: false
with:
shard: ${{ matrix.shard }}
shard: ${{ matrix.shard }}

storybook-build-android:
name: Storybook Build Android
if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }}
uses: ./.github/workflows/storybook-build-android.yml
needs: [e2e-hold]
secrets: inherit

storybook-run-android:
name: Storybook Run Android
if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }}
uses: ./.github/workflows/maestro-storybook-android.yml
needs: [storybook-build-android]
secrets: inherit
85 changes: 85 additions & 0 deletions .github/workflows/maestro-storybook-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Maestro Storybook Tests on Android

on:
workflow_call:

jobs:
android-test:
name: 'Android Tests'
runs-on: ubuntu-latest
env:
MAESTRO_VERSION: 2.3.0

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17

- name: Cache Android AVD
uses: actions/cache@v4
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ runner.os }}-api34

- name: Cache Maestro
uses: actions/cache@v4
with:
path: ~/.maestro
key: maestro-${{ runner.os }}-${{ env.MAESTRO_VERSION }}

- name: Download APK
uses: actions/download-artifact@v4
with:
name: Android Experimental Storybook APK

- name: Install Maestro
run: |
curl -Ls "https://get.maestro.mobile.dev" | bash
echo "$HOME/.maestro/bin" >> "$GITHUB_PATH"

- name: Enable KVM group permissions
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: Disable unnecessary services (improves emulator stability)
run: |
sudo systemctl stop docker || true
sudo systemctl stop snapd || true

- name: Make Maestro script executable
run: chmod +x .github/scripts/run-maestro.sh

- name: Start Android Emulator and Run Maestro Tests
uses: reactivecircus/android-emulator-runner@v2
timeout-minutes: 60
with:
api-level: 34
disk-size: 4096M
arch: x86_64
target: google_apis
profile: pixel_7_pro
cores: 4
ram-size: 4096M
force-avd-creation: false
disable-animations: true
emulator-boot-timeout: 900
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -accel on
script: |
maestro test .maestro/storybook/storybook.yaml

- name: Android Storybook Maestro Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: Android Storybook Maestro Logs
path: ~/.maestro/tests/**/*.png
retention-days: 7
97 changes: 97 additions & 0 deletions .github/workflows/storybook-build-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: E2E Build Android

on:
workflow_call:
secrets:
EXPERIMENTAL_KEYSTORE_BASE64:
required: true
EXPERIMENTAL_KEYSTORE_PASSWORD:
required: true
EXPERIMENTAL_KEY_ALIAS:
required: true
EXPERIMENTAL_KEY_PASSWORD:
required: true
BUGSNAG_KEY:
required: true

jobs:
android-build:
runs-on: ubuntu-latest

outputs:
artifact_name: Android Experimental Storybook APK

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Checkout and Setup Node
uses: ./.github/actions/setup-node

- name: Cache Gradle dependencies
uses: actions/cache@v4
with:
path: |
~/.gradle
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
gradle-${{ runner.os }}-

- name: Cache Android build
uses: actions/cache@v4
with:
path: |
android/.gradle
android/app/build
android/app/.cxx
key: android-build-${{ runner.os }}-${{ hashFiles('package.json', '**/*.gradle*', 'android/gradle.properties', 'android/settings.gradle') }}
restore-keys: |
android-build-${{ runner.os }}-

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: wrapper

- name: Decode Keystore
run: |
echo "${{ secrets.EXPERIMENTAL_KEYSTORE_BASE64 }}" | base64 -d > android/app/release.keystore

- name: Set gradle.properties
working-directory: android
run: |
echo "" > ./gradle.properties
echo -e "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8" >> ./gradle.properties
echo -e "android.useAndroidX=true" >> ./gradle.properties
echo -e "android.enableJetifier=true" >> ./gradle.properties
echo -e "reactNativeArchitectures=x86_64" >> ./gradle.properties
echo -e "APPLICATION_ID=chat.rocket.reactnative" >> ./gradle.properties
echo -e "newArchEnabled=true" >> ./gradle.properties
echo -e "hermesEnabled=true" >> ./gradle.properties
echo -e "VERSIONCODE=999999" >> ./gradle.properties
echo -e "KEYSTORE=release.keystore" >> ./gradle.properties
echo -e "KEYSTORE_PASSWORD=${{ secrets.EXPERIMENTAL_KEYSTORE_PASSWORD }}" >> ./gradle.properties
echo -e "KEY_ALIAS=${{ secrets.EXPERIMENTAL_KEY_ALIAS }}" >> ./gradle.properties
echo -e "KEY_PASSWORD=${{ secrets.EXPERIMENTAL_KEY_PASSWORD }}" >> ./gradle.properties
echo -e "BugsnagAPIKey=${{ secrets.BUGSNAG_KEY }}" >> ./gradle.properties

- name: Build Android Release APK
working-directory: android
run: USE_STORYBOOK=true ./gradlew assembleExperimentalRelease --build-cache --parallel --max-workers=4 --no-daemon --stacktrace
env:
RUNNING_E2E_TESTS: true

- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: Android Experimental Storybook APK
path: android/app/build/outputs/apk/experimental/release/app-experimental-release.apk
Binary file added .maestro/screenshots/avatar--avatar-base-64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .maestro/screenshots/avatar--avatar-path.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .maestro/screenshots/avatar--avatar-room-id.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .maestro/screenshots/avatar--avatar-text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .maestro/screenshots/avatar--avatar-url.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .maestro/screenshots/avatar--channel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .maestro/screenshots/avatar--children.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .maestro/screenshots/avatar--custom-style.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .maestro/screenshots/avatar--direct.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .maestro/screenshots/avatar--emoji.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .maestro/screenshots/avatar--static.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .maestro/screenshots/avatar--touchable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .maestro/screenshots/avatar--with-e-tag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .maestro/screenshots/avatar--without-e-tag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .maestro/screenshots/avatar--wrong-server.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .maestro/screenshots/button--custom-button.png
Binary file added .maestro/screenshots/button--disabled-button.png
Binary file added .maestro/screenshots/button--secondary-button.png
Binary file added .maestro/screenshots/button--small-button.png
Binary file added .maestro/screenshots/chip--chip-full-width.png
Binary file added .maestro/screenshots/chip--chip-text.png
Binary file added .maestro/screenshots/chip--chip-without-icon.png
Binary file added .maestro/screenshots/collapsible-text--item.png
Binary file added .maestro/screenshots/collapsiblequote--item.png
Binary file added .maestro/screenshots/directoryitem--team-main.png
Binary file added .maestro/screenshots/headerbuttons--badge.png
Binary file added .maestro/screenshots/headerbuttons--common.png
Binary file added .maestro/screenshots/headerbuttons--icons.png
Binary file added .maestro/screenshots/headerbuttons--themes.png
Binary file added .maestro/screenshots/headerbuttons--title.png
Binary file added .maestro/screenshots/list--alert.png
Binary file added .maestro/screenshots/list--header.png
Binary file added .maestro/screenshots/list--icon.png
Binary file added .maestro/screenshots/list--pressable.png
Binary file added .maestro/screenshots/list--radio.png
Binary file added .maestro/screenshots/list--section-and-info.png
Binary file added .maestro/screenshots/list--separator.png
Binary file added .maestro/screenshots/list--with-black-theme.png
Binary file added .maestro/screenshots/list--with-custom-colors.png
Binary file added .maestro/screenshots/list--with-dark-theme.png
Binary file added .maestro/screenshots/list--with-flat-list.png
Binary file added .maestro/screenshots/list--with-icon.png
Binary file added .maestro/screenshots/list--with-small-font.png
Binary file added .maestro/screenshots/markdown--block-quote.png
Binary file added .maestro/screenshots/markdown--code.png
Binary file added .maestro/screenshots/markdown--emoji.png
Binary file added .maestro/screenshots/markdown--hashtag.png
Binary file added .maestro/screenshots/markdown--headers.png
Binary file added .maestro/screenshots/markdown--image.png
Binary file added .maestro/screenshots/markdown--links.png
Binary file added .maestro/screenshots/markdown--lists.png
Binary file added .maestro/screenshots/markdown--mentions.png
Binary file added .maestro/screenshots/markdown--preview.png
Binary file added .maestro/screenshots/markdown--text.png
Binary file added .maestro/screenshots/markdown--timestamp.png
Binary file added .maestro/screenshots/message--archived.png
Binary file added .maestro/screenshots/message--avatar.png
Binary file added .maestro/screenshots/message--basic.png
Binary file added .maestro/screenshots/message--block-quote.png
Binary file added .maestro/screenshots/message--broadcast.png
Binary file added .maestro/screenshots/message--custom-fields.png
Binary file added .maestro/screenshots/message--discussion.png
Binary file added .maestro/screenshots/message--edited.png
Binary file added .maestro/screenshots/message--editing.png
Binary file added .maestro/screenshots/message--emojis.png
Binary file added .maestro/screenshots/message--encrypted.png
Binary file added .maestro/screenshots/message--error.png
Binary file added .maestro/screenshots/message--full-name.png
Binary file added .maestro/screenshots/message--ignored.png
Binary file added .maestro/screenshots/message--inline-katex.png
Binary file added .maestro/screenshots/message--katex-array.png
Binary file added .maestro/screenshots/message--katex.png
Binary file added .maestro/screenshots/message--lists.png
Binary file added .maestro/screenshots/message--long-name-user.png
Binary file added .maestro/screenshots/message--mentions.png
Binary file added .maestro/screenshots/message--message.png
Binary file added .maestro/screenshots/message--pinned.png
Binary file added .maestro/screenshots/message--reactions.png
Binary file added .maestro/screenshots/message--static-avatar.png
Binary file added .maestro/screenshots/message--temp-large-font.png
Binary file added .maestro/screenshots/message--temp.png
Binary file added .maestro/screenshots/message--time-format.png
Binary file added .maestro/screenshots/message--translated.png
Binary file added .maestro/screenshots/message--url-large-font.png
Binary file added .maestro/screenshots/message--url.png
Binary file added .maestro/screenshots/message--with-alias.png
Binary file added .maestro/screenshots/message--with-audio.png
Binary file added .maestro/screenshots/message--with-file.png
Binary file added .maestro/screenshots/message--with-image.png
Binary file added .maestro/screenshots/message--with-video.png
Binary file added .maestro/screenshots/message--without-header.png
Binary file added .maestro/screenshots/roomheader--icons.png
Binary file added .maestro/screenshots/roomheader--themes.png
Binary file added .maestro/screenshots/roomheader--thread.png
Binary file added .maestro/screenshots/roomheader--typing.png
Binary file added .maestro/screenshots/roominfoabac--black.png
Binary file added .maestro/screenshots/roominfoabac--dark.png
Binary file added .maestro/screenshots/roominfoabac--light.png
Binary file added .maestro/screenshots/roomitem--alerts.png
Binary file added .maestro/screenshots/roomitem--basic.png
Binary file added .maestro/screenshots/roomitem--invited-room.png
Binary file added .maestro/screenshots/roomitem--last-message.png
Binary file added .maestro/screenshots/roomitem--tag.png
Binary file added .maestro/screenshots/roomitem--touch.png
Binary file added .maestro/screenshots/roomitem--type.png
Binary file added .maestro/screenshots/roomitem--user.png
Binary file added .maestro/screenshots/roomtypeicon--all.png
Binary file added .maestro/screenshots/roomview-loadmore--basic.png
Binary file added .maestro/screenshots/searchbox--basic.png
Binary file added .maestro/screenshots/serveritem--content.png
Binary file added .maestro/screenshots/serveritem--themes.png
Binary file added .maestro/screenshots/status--all.png
Binary file added .maestro/screenshots/switchitem--switch.png
Binary file added .maestro/screenshots/textinput--icons.png
Binary file added .maestro/screenshots/textinput--loading.png
Binary file added .maestro/screenshots/textinput--multiline.png
Binary file added .maestro/screenshots/unread-badge--all.png
Binary file added .maestro/screenshots/unread-badge--normal.png
Binary file added .maestro/screenshots/unread-badge--small.png
Binary file added .maestro/screenshots/unread-badge--themes.png
Loading
Loading