Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(CI): run e2e tests on Fabric #2734

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
19ae144
Add build scripts
kkafar Feb 22, 2025
cdd5b26
Add Fabric CI
kkafar Feb 22, 2025
0b91a01
Add Fabric detox configuration
kkafar Feb 22, 2025
efb2df0
Copy tests & do not duplicate test-butler apk
kkafar Feb 22, 2025
3f3bb2e
Hopefully correctly setup detox in FabricExample native code
kkafar Feb 22, 2025
8855e13
Fixup workflow definition
kkafar Feb 22, 2025
86d38cd
wtf, I'm sure I've already done that once... copy & adjust detox config
kkafar Feb 22, 2025
1c38e28
Add dependency on ts-jest + workflow improvements
kkafar Feb 22, 2025
74a93ea
Fix emulator name...
kkafar Feb 22, 2025
ae5d4a0
Add workflow for iOS + remove wrongly placed detox config
kkafar Feb 22, 2025
d5ba70d
Style changes in Example/android/app/build.gradle
kkafar Feb 22, 2025
a5bfb56
Add libxkbfile to list of emulator dependencies
kkafar Feb 23, 2025
592529f
Try to fix AVD emulator cache
kkafar Feb 23, 2025
e5dfa9e
Fix libxkbfile1 lib name
kkafar Feb 23, 2025
b728863
Fix AVD cache for old architecture Android e2e workflow
kkafar Feb 23, 2025
195face
Fix typo
kkafar Feb 23, 2025
b7ba0ca
Make Android tests work in local env assuming it's taking place on arm64
kkafar Feb 23, 2025
f5bfdfb
Extract common detox configuration to detox utils
kkafar Feb 23, 2025
63fa9c0
Add some basic Android emulator detection
kkafar Feb 23, 2025
2148caf
Code improvements
kkafar Feb 23, 2025
0445deb
Small improvement in utils code
kkafar Feb 23, 2025
6fc5b4a
Temporarily disable part of bottom tabs test on new architecture
kkafar Feb 23, 2025
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
124 changes: 124 additions & 0 deletions .github/workflows/android-e2e-test-fabric.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Test Android e2e - new architecture
on:
pull_request:
paths:
- '.github/workflows/android-e2e-test-fabric.yml'
- 'package.json'
- 'android/**'
- 'common/**'
- 'FabricExample/**'
- 'src/**'
push:
branches:
- main
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 60
env:
WORKING_DIRECTORY: FabricExample
API_LEVEL: 34
concurrency:
group: android-e2e-fabric-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: false

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

- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
- name: Install root node dependencies

run: yarn install && yarn submodules

- name: Install node dependencies
id: install_deps
working-directory: ${{ env.WORKING_DIRECTORY }}
continue-on-error: true
run: yarn install

- if: steps.install_deps.outcome == 'failure'
name: Reinstall node dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn

- name: Install AVD dependencies
# libxkbfile1 is removed by "Free Disk Space (Ubuntu)" step first. Here we install it again
# as it seems to be needed by the emulator.
run: |
sudo apt update
sudo apt-get install -y libpulse0 libgl1 libxkbfile1

- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn build-e2e-android

- name: Enable KVM
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: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ env.API_LEVEL }}

- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.API_LEVEL }}
target: default
profile: pixel_2
ram-size: '4096M'
disk-size: '10G'
disable-animations: false
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
avd-name: e2e_emulator
arch: x86_64
script: echo "Generated AVD snapshot for caching."

- name: Run emulator and tests
uses: reactivecircus/android-emulator-runner@v2
with:
working-directory: ${{ env.WORKING_DIRECTORY }}
api-level: ${{ env.API_LEVEL }}
target: default
profile: pixel_2
ram-size: '4096M'
disk-size: '10G'
disable-animations: false
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
avd-name: e2e_emulator
arch: x86_64
script: yarn test-e2e-android

- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: android-fail-screen-shots
path: ${{ env.WORKING_DIRECTORY }}/artifacts
32 changes: 31 additions & 1 deletion .github/workflows/android-e2e-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test Android e2e
name: Test Android e2e - old architecture
on:
pull_request:
paths:
Expand All @@ -25,45 +25,55 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: false

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

- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'

- name: Install root node dependencies
run: yarn install && yarn submodules

- name: Install node dependencies
id: install_deps
working-directory: ${{ env.WORKING_DIRECTORY }}
continue-on-error: true
run: yarn install

- if: steps.install_deps.outcome == 'failure'
name: Reinstall node dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn

- name: Install AVD dependencies
run: |
sudo apt update
sudo apt-get install -y libpulse0 libgl1

- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn build-e2e-android

- name: Enable KVM
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: AVD cache
uses: actions/cache@v4
id: avd-cache
Expand All @@ -72,6 +82,23 @@ jobs:
~/.android/avd/*
~/.android/adb*
key: avd-${{ env.API_LEVEL }}

- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.API_LEVEL }}
target: default
profile: pixel_2
ram-size: '4096M'
disk-size: '10G'
disable-animations: false
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
avd-name: e2e_emulator
arch: x86_64
script: echo "Generated AVD snapshot for caching."

- name: Run emulator and tests
uses: reactivecircus/android-emulator-runner@v2
with:
Expand All @@ -82,9 +109,12 @@ jobs:
ram-size: '4096M'
disk-size: '10G'
disable-animations: false
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
avd-name: e2e_emulator
arch: x86_64
script: yarn test-e2e-android

- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/ios-e2e-test-fabric.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Test iOS e2e - new architecture
on:
pull_request:
paths:
- '.github/workflows/ios-e2e-test-fabric.yml'
- 'RNScreens.podspec'
- 'package.json'
- 'ios/**'
- 'common/**'
- 'FabricExample/**'
- 'src/**'
push:
branches:
- main
workflow_dispatch:
jobs:
test:
runs-on: macos-14
timeout-minutes: 60
env:
WORKING_DIRECTORY: FabricExample
concurrency:
group: ios-e2e-fabric-${{ github.ref }}
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
- name: Use latest stable Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.1'
- name: Get Xcode version
run: xcodebuild -version
- name: Install AppleSimulatorUtils
run: brew tap wix/brew && brew install applesimutils
- name: Install root node dependencies
run: yarn install && yarn submodules
- name: Install node dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn
# This step is required due to the bug introduced in 1.15.0 version of cocoapods
# that breaks the pod installation for cached packages.
# see https://github.com/facebook/react-native/issues/42698
# This step should be removed once this issue will be resolved:
# https://github.com/actions/runner-images/issues/9308
- name: Install Ruby gems
run: gem install cocoapods -v 1.15.2
- name: Install pods
working-directory: ${{ env.WORKING_DIRECTORY }}/ios
run: pod install
- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn build-e2e-ios
- name: Test app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn test-e2e-ios
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: ios-fail-screen-shots
path: ${{ env.WORKING_DIRECTORY }}/artifacts
2 changes: 1 addition & 1 deletion .github/workflows/ios-e2e-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test iOS e2e
name: Test iOS e2e - old architecture
on:
pull_request:
paths:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@ android/.settings

# yarn
**/.yarn/install-state.gz

# Local environment (direnv)
.envrc

Loading
Loading