Skip to content
Merged
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
18 changes: 1 addition & 17 deletions .github/workflows/brownfield.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,47 +39,31 @@ jobs:
runs-on: ubuntu-24.04
outputs:
all_tests: ${{ steps.filter.outputs.all_tests }}
cli_e2e: ${{ steps.filter.outputs.cli_e2e }}
plugin_e2e: ${{ steps.filter.outputs.plugin_e2e }}
compilation_test_android: ${{ steps.filter.outputs.compilation_test_android }}
compilation_test_ios: ${{ steps.filter.outputs.compilation_test_ios }}
steps:
- name: 👀 Checkout
uses: actions/checkout@v5
- uses: dorny/paths-filter@v3
id: filter
# TODO(pmleczek): Update paths once we wrap up Maestro tests (remove expo-brownfield/**)
# TODO(pmleczek): Add "- 'packages/expo-updates/**'" to the compilation test filters
with:
filters: |
all_tests:
- '.github/workflows/brownfield.yml'
- 'yarn.lock'
cli_e2e:
- 'packages/expo-brownfield/bin/**'
- 'packages/expo-brownfield/cli/**'
- 'packages/expo-brownfield/e2e/cli/**'
- 'packages/expo-brownfield/e2e/utils/**'
- 'packages/expo-brownfield/package.json'
plugin_e2e:
- 'packages/expo-brownfield/plugin/**'
- 'packages/expo-brownfield/e2e/plugin/**'
- 'packages/expo-brownfield/e2e/utils/**'
- 'packages/expo-brownfield/app.plugin.js'
- 'packages/expo-brownfield/package.json'
compilation_test_android:
- 'packages/expo-brownfield/**'
- 'packages/expo/android/src/main/jave/expo/modules/**'
- 'packages/expo/android/build.gradle'
- 'packages/expo-dev-menu/android/src/debug/java/expo/modules/devmenu/**'
- 'packages/expo-dev-menu/android/build.gradle'
- 'packages/expo-manifests/android/src/main/java/expo/modules/manifests/**'
- 'packages/expo-manifests/android/build.gradle'
compilation_test_ios:
- 'packages/expo-brownfield/**'
- 'packages/expo/ios/AppDelegates/**'
- 'packages/expo-dev-menu/ios/**'
- 'packages/expo-manifests/ios/EXManifests/**'
- 'packages/expo-modules-core/ios/**'
compilation-test-android:
runs-on: ubuntu-24.04
Expand Down
74 changes: 51 additions & 23 deletions .github/workflows/test-suite-brownfield-isolated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,21 @@ jobs:
npx expo prebuild --clean -p android
npx expo-brownfield build:android --repo MavenLocal --verbose
working-directory: apps/brownfield-tester/expo-app
- name: 🏗️ Build APK
- name: 🏗️ Build Debug APK
run: |
./gradlew clean assembleDebug --refresh-dependencies
working-directory: apps/brownfield-tester/android-integrated
- name: 💾 Store Debug APK artifact
uses: actions/upload-artifact@v4
with:
name: expo-brownfield-android-debug
path: apps/brownfield-tester/android-integrated/app/build/outputs/apk/debug/app-debug.apk
- name: 🏗️ Build Release APK
run: |
./gradlew clean
./gradlew assembleRelease --refresh-dependencies
working-directory: apps/brownfield-tester/android-integrated
- name: 💾 Store APK artifact
- name: 💾 Store Release APK artifact
uses: actions/upload-artifact@v4
with:
name: expo-brownfield-android-release
Expand All @@ -122,23 +131,43 @@ jobs:
# Version `1.x` fails due to https://github.com/oven-sh/setup-bun/issues/37
# TODO(cedric): swap `latest` back once the issue is resolved
bun-version: latest
- name: 🌠 Download builds
- name: 🌠 Download build (Release)
uses: actions/download-artifact@v4
with:
name: expo-brownfield-android-release
path: apps/brownfield-tester/android-integrated/apk
- name: 🌠 Download build (Debug)
uses: actions/download-artifact@v4
with:
name: expo-brownfield-android-debug
path: apps/brownfield-tester/android-integrated/apk
- name: 🍺 Install Maestro
run: |
curl -Ls "https://get.maestro.mobile.dev" | bash
echo "${HOME}/.maestro/bin" >> $GITHUB_PATH
- name: 🧪 Run e2e tests (isolated brownfield)
- name: 🧪 Run e2e tests (Release)
uses: ./.github/actions/use-android-emulator
with:
avd-api: ${{ matrix.api-level }}
avd-name: avd-${{ matrix.api-level }}
script:
./packages/expo-brownfield/e2e/scripts/run-e2e-android.sh
- name: 🧶 Install node modules in root dir
run: yarn install --frozen-lockfile
- name: 👷 Build Expo CLI
run: yarn workspace @expo/cli prepare
- name: 🚇 Start Metro server
run: |
yarn start --clear &
npx wait-on http://localhost:8081 --timeout 60000
working-directory: apps/brownfield-tester/expo-app
- name: 🧪 Run e2e tests (Debug)
uses: ./.github/actions/use-android-emulator
with:
avd-api: ${{ matrix.api-level }}
avd-name: avd-${{ matrix.api-level }}
script: |
adb install -r apps/brownfield-tester/android-integrated/apk/*.apk
cd packages/expo-brownfield/e2e && maestro test maestro/__tests__/android
CONFIGURATION=Debug ./packages/expo-brownfield/e2e/scripts/run-e2e-android.sh
- name: 🔔 Notify on Slack
uses: ./.github/actions/slack-notify
if: failure() && (github.event.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/heads/sdk-'))
Expand All @@ -147,16 +176,10 @@ jobs:
channel: '#expo-android'
author_name: E2E Test Suite for Expo Brownfield

ios-e2e:
ios-build-and-e2e:
runs-on: macos-15
needs: detect-platform-for-e2e
if: needs.detect-platform-for-e2e.outputs.should_run_ios == 'true'
strategy:
fail-fast: false
matrix:
build-type: [release]
# TODO(pmleczek): Add dev menu tests for iOS and Android
# build-type: [debug, release]
steps:
- name: 👀 Checkout
uses: actions/checkout@v5
Expand Down Expand Up @@ -203,25 +226,30 @@ jobs:
run: yarn install --frozen-lockfile
- name: 👷 Build Expo CLI
run: yarn workspace @expo/cli prepare
- name: 🍏 Build iOS artifacts (apps/brownfield-tester/expo-app)
- name: 🍏 Build iOS artifacts (Release)
run: |
npx expo prebuild --clean -p ios
npx expo-brownfield build:ios --${{ matrix.build-type }} --verbose -a ../../../artifacts -p BrownfieldPackage
npx expo-brownfield build:ios -r --verbose -a ../../../artifacts -p BrownfieldPackage
working-directory: apps/brownfield-tester/expo-app
- name: 💾 Save ccache
if: always()
uses: actions/cache/save@v4
with:
path: ${{ runner.temp }}/.ccache
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}
- name: 🔨 Add brownfield Swift Package to the app
- name: 🔨 Add XCFrameworks to SwiftUI project
run: ruby packages/expo-brownfield/e2e/scripts/add_xcframeworks.rb
- name: 🍺 Install Maestro
run: |
curl -Ls "https://get.maestro.mobile.dev" | bash
echo "${HOME}/.maestro/bin" >> $GITHUB_PATH
- name: 🧪 Run e2e tests (isolated brownfield)
- name: 🧪 Run e2e tests (Release)
run: ./packages/expo-brownfield/e2e/scripts/run-e2e-ios.sh
- name: 🍏 Build iOS artifacts (Debug)
run: |
npx expo-brownfield build:ios -d --verbose -a ../../../artifacts -p BrownfieldPackage
- name: 🧪 Run e2e tests (Debug)
run: CONFIGURATION=Debug ./packages/expo-brownfield/e2e/scripts/run-e2e-ios.sh
- name: 💾 Save ccache
if: always()
uses: actions/cache/save@v4
with:
path: ${{ runner.temp }}/.ccache
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}
- name: Show ccache stats
run: ccache -s -v
- name: 🔔 Notify on Slack
Expand Down
8 changes: 4 additions & 4 deletions apps/bare-expo/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2958,7 +2958,7 @@ PODS:
- ReactNativeDependencies
- RNWorklets
- Yoga
- RNScreens (4.23.0):
- RNScreens (4.24.0):
- hermes-engine
- RCTRequired
- RCTTypeSafety
Expand All @@ -2980,9 +2980,9 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- ReactNativeDependencies
- RNScreens/common (= 4.23.0)
- RNScreens/common (= 4.24.0)
- Yoga
- RNScreens/common (4.23.0):
- RNScreens/common (4.24.0):
- hermes-engine
- RCTRequired
- RCTTypeSafety
Expand Down Expand Up @@ -3995,7 +3995,7 @@ SPEC CHECKSUMS:
RNDateTimePicker: 5e0666de98f1edfac67ee7dde6be8a5415e487a0
RNGestureHandler: 6d378fd1aa991c7ab62a4215ee6cc417895a6954
RNReanimated: 752b27ede7d3f8970d5adba71f10258cb7848150
RNScreens: fb11b7412bcbdc0ffafcaf9174938d998d4e2bc4
RNScreens: 088d923c4327c63c9f8c942cae17a9d038f47d97
RNSVG: 13970bfde0ea9c9e10e01ab0d7b4a6cde11fca1b
RNWorklets: 460112a8b250bcecd1b6b68d39a82fcdb6f8eb24
SDWebImage: e9c98383c7572d713c1a0d7dd2783b10599b9838
Expand Down
2 changes: 1 addition & 1 deletion apps/bare-expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"react-native-reanimated": "4.2.2",
"react-native-safe-area-context": "5.6.2",
"react-native-svg": "15.15.3",
"react-native-screens": "4.23.0",
"react-native-screens": "4.24.0",
"react-native-view-shot": "4.0.3",
"react-native-webview": "13.16.0",
"react-native-worklets": "0.7.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package dev.expo.brownfieldintegratedtester

import android.util.Log
import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler
import expo.modules.brownfield.BrownfieldMessage
import expo.modules.brownfield.BrownfieldMessaging
Expand All @@ -26,7 +27,7 @@ open class BrownfieldTestActivity : BrownfieldActivity(), DefaultHardwareBackBtn
BrownfieldMessaging.addListener { message ->
Log.i("BrownfieldTestActivity", "Message from React Native received:")
Log.i("BrownfieldTestActivity", message.toString())
showToast(message)
showDialog(message)
}

setupStateListeners()
Expand Down Expand Up @@ -97,12 +98,20 @@ open class BrownfieldTestActivity : BrownfieldActivity(), DefaultHardwareBackBtn
messageTimer = null
}

private fun showToast(message: BrownfieldMessage) {
private fun showDialog(message: BrownfieldMessage) {
val sender = message["sender"] as? String
val nested = message["source"] as? Map<*, *>
val platform = nested?.get("platform") as? String
if (sender != null && platform != null) {
Toast.makeText(this, "$platform($sender)", Toast.LENGTH_LONG).show()
runOnUiThread {
AlertDialog.Builder(this)
.setTitle("Message Received") // Optional: give it a title
.setMessage("$platform($sender)")
.setPositiveButton("OK") { dialog, _ ->
dialog.dismiss() // Closes the dialog when clicked
}
.show()
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion apps/brownfield-tester/expo-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"react-native-worklets": "0.7.4",
"react-native-reanimated": "~4.2.2",
"react-native-safe-area-context": "~5.6.2",
"react-native-screens": "~4.23.0",
"react-native-screens": "~4.24.0",
"react-native-web": "~0.21.0"
},
"devDependencies": {
Expand Down
21 changes: 21 additions & 0 deletions apps/brownfield-tester/expo-app/src/app/apis/dev-menu.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import * as ExpoDevMenu from 'expo-dev-menu';
import { SafeAreaView } from 'react-native-safe-area-context';

import { ActionButton, Header } from '@/components';

const Navigation = () => {
return (
<SafeAreaView>
<Header title="Dev Menu" testID="dev-menu-header" />
<ActionButton
title="Open Dev Menu"
description="Open the dev menu"
icon="code"
onPress={() => ExpoDevMenu.openMenu()}
testID="dev-menu-open"
/>
</SafeAreaView>
);
};

export default Navigation;
12 changes: 11 additions & 1 deletion apps/brownfield-tester/expo-app/src/app/apis/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import { SafeAreaView } from 'react-native-safe-area-context';

import { ActionButton } from '@/components';

type Screen = 'communication' | 'dev-menu' | 'navigation' | 'state';

const Index = () => {
const router = useRouter();

const navigateToScreen = (screen: 'communication' | 'navigation' | 'state') => {
const navigateToScreen = (screen: Screen) => {
router.navigate(`/apis/${screen}`);
};

Expand Down Expand Up @@ -37,6 +39,14 @@ const Index = () => {
onPress={() => navigateToScreen('state')}
testID="apis-state"
/>
<ActionButton
type="link"
icon="code"
title="Dev Menu"
description="Dev Menu API"
onPress={() => navigateToScreen('dev-menu')}
testID="apis-dev-menu"
/>
</SafeAreaView>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { View, Text, Pressable, StyleSheet } from 'react-native';

import type { HeaderProps } from './types';

const Header = ({ title }: HeaderProps) => {
const Header = ({ title, testID }: HeaderProps) => {
const router = useRouter();

return (
Expand All @@ -15,7 +15,7 @@ const Header = ({ title }: HeaderProps) => {
testID="header-back-button">
<Feather name="arrow-left" size={24} color="black" />
</Pressable>
<Text style={styles.title}>{title}</Text>
<Text style={styles.title} testID={testID}>{title}</Text>
</View>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export interface HeaderProps {
title: string;
testID?: string;
}
8 changes: 4 additions & 4 deletions apps/expo-go/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3739,7 +3739,7 @@ PODS:
- RNWorklets
- SocketRocket
- Yoga
- RNScreens (4.23.0):
- RNScreens (4.24.0):
- boost
- DoubleConversion
- fast_float
Expand All @@ -3766,10 +3766,10 @@ PODS:
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- RNScreens/common (= 4.23.0)
- RNScreens/common (= 4.24.0)
- SocketRocket
- Yoga
- RNScreens/common (4.23.0):
- RNScreens/common (4.24.0):
- boost
- DoubleConversion
- fast_float
Expand Down Expand Up @@ -4868,7 +4868,7 @@ SPEC CHECKSUMS:
RNDateTimePicker: e9e210197c267461f70f3f47bec705401ff72077
RNGestureHandler: 0ac42879420bf5353c06174d14af11f6435f3294
RNReanimated: f60cb180f1540dde5e14d1fdc09d20a3552ee3ff
RNScreens: ec8bdc9f024d5828e5adf4f5e8870d5260cff616
RNScreens: 7179cc1ba31b4e18ed29f10abf20c24a7961cf4c
RNSVG: 15c97a81fe80139227609070b1c11a86dce5c9b6
RNWorklets: 7f524b9625dc3d9f1014ae6529fdd25a0141c922
SDWebImage: f29024626962457f3470184232766516dee8dfea
Expand Down
2 changes: 1 addition & 1 deletion apps/expo-go/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"react-native-reanimated": "4.2.2",
"react-native-safe-area-context": "5.6.2",
"react-native-svg": "15.15.3",
"react-native-screens": "4.23.0",
"react-native-screens": "4.24.0",
"react-native-view-shot": "4.0.3",
"react-native-webview": "13.16.0",
"react-native-worklets": "0.7.4",
Expand Down
2 changes: 1 addition & 1 deletion apps/native-component-list/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"react-native-reanimated": "4.2.2",
"react-native-safe-area-context": "5.6.2",
"react-native-svg": "15.15.3",
"react-native-screens": "4.23.0",
"react-native-screens": "4.24.0",
"react-native-view-shot": "4.0.3",
"react-native-web": "~0.21.0",
"react-native-webview": "13.16.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/notification-tester/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"react": "19.2.3",
"react-native": "0.84.1",
"react-native-safe-area-context": "5.6.2",
"react-native-screens": "4.23.0"
"react-native-screens": "4.24.0"
},
"devDependencies": {
"@babel/core": "^7.20.0",
Expand Down
Loading
Loading