Skip to content
Open
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
30 changes: 9 additions & 21 deletions .github/workflows/ci-e2e-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
env:
YARN_ENABLE_HARDENED_MODE: 0
XCODE_VERSION: '26.2'
ANDROID_SKIP_DOWNLOADS: 1
strategy:
matrix:
include:
Expand Down Expand Up @@ -42,25 +43,20 @@ jobs:
- name: devbox installer
uses: jetify-com/devbox-install-action@v0.14.0
with:
project-path: shells/devbox-ios.json
enable-cache: 'false'
- name: Resolve iOS targets
run: |
. scripts/platform-versions.sh
if [ "${{ matrix.name }}" = "ios-min" ]; then
echo "DETOX_IOS_DEVICE=${PLATFORM_IOS_MIN_DEVICE}" >> "$GITHUB_ENV"
echo "IOS_RUNTIME=${PLATFORM_IOS_MIN_RUNTIME}" >> "$GITHUB_ENV"
else
echo "DETOX_IOS_DEVICE=${PLATFORM_IOS_MAX_DEVICE}" >> "$GITHUB_ENV"
echo "IOS_RUNTIME=${PLATFORM_IOS_MAX_RUNTIME}" >> "$GITHUB_ENV"
fi
target=${{ matrix.name == 'ios-min' && 'min' || 'max' }}
device_json="devbox.d/segment-integrations.devbox-plugins.ios/devices/${target}.json"
echo "DETOX_IOS_DEVICE=$(jq -r '.name' "$device_json")" >> "$GITHUB_ENV"
- name: iOS E2E Tests
run: devbox run --config=shells/devbox-ios.json test-ios
run: devbox run test-ios

run-e2e-android:
runs-on: ubuntu-24.04-arm
env:
EMU_HEADLESS: 1
IOS_SKIP_SETUP: 1
strategy:
matrix:
include:
Expand Down Expand Up @@ -89,19 +85,11 @@ jobs:
- name: devbox installer
uses: jetify-com/devbox-install-action@v0.14.0
with:
project-path: shells/devbox-android.json
enable-cache: 'false'
- name: Resolve Android targets
run: |
. scripts/platform-versions.sh
if [ "${{ matrix.target }}" = "min" ]; then
api="$PLATFORM_ANDROID_MIN_API"
device="$PLATFORM_ANDROID_MIN_DEVICE"
else
api="$PLATFORM_ANDROID_MAX_API"
device="$PLATFORM_ANDROID_MAX_DEVICE"
fi
avd_name="${device}_API${api}_arm64_v8a"
device_json="devbox.d/segment-integrations.devbox-plugins.android/devices/${{ matrix.target }}.json"
avd_name=$(jq -r '.name' "$device_json")
echo "DETOX_AVD=${avd_name}" >> "$GITHUB_ENV"
- name: Android E2E Tests
run: devbox run --config=shells/devbox-android.json test-android
run: devbox run test-android
19 changes: 8 additions & 11 deletions .github/workflows/ci-e2e-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
env:
YARN_ENABLE_HARDENED_MODE: 0
XCODE_VERSION: '26.2'
ANDROID_SKIP_DOWNLOADS: 1
steps:
- uses: actions/checkout@v4
- name: Aggressive disk cleanup (macOS)
Expand All @@ -35,20 +36,19 @@ jobs:
- name: devbox installer
uses: jetify-com/devbox-install-action@v0.14.0
with:
project-path: shells/devbox-ios.json
enable-cache: 'false'
- name: Resolve iOS targets
run: |
. scripts/platform-versions.sh
echo "DETOX_IOS_DEVICE=${PLATFORM_IOS_MAX_DEVICE}" >> "$GITHUB_ENV"
echo "IOS_RUNTIME=${PLATFORM_IOS_MAX_RUNTIME}" >> "$GITHUB_ENV"
device_json="devbox.d/segment-integrations.devbox-plugins.ios/devices/max.json"
echo "DETOX_IOS_DEVICE=$(jq -r '.name' "$device_json")" >> "$GITHUB_ENV"
- name: iOS E2E Tests (latest)
run: devbox run --config=shells/devbox-ios.json test-ios
run: devbox run test-ios

run-e2e-android:
runs-on: ubuntu-24.04-arm
env:
EMU_HEADLESS: 1
IOS_SKIP_SETUP: 1
steps:
- uses: actions/checkout@v4
- name: Aggressive disk cleanup (Ubuntu)
Expand All @@ -70,14 +70,11 @@ jobs:
- name: devbox installer
uses: jetify-com/devbox-install-action@v0.14.0
with:
project-path: shells/devbox-android.json
enable-cache: 'false'
- name: Resolve Android targets
run: |
. scripts/platform-versions.sh
api="$PLATFORM_ANDROID_MAX_API"
device="$PLATFORM_ANDROID_MAX_DEVICE"
avd_name="${device}_API${api}_arm64_v8a"
device_json="devbox.d/segment-integrations.devbox-plugins.android/devices/max.json"
avd_name=$(jq -r '.name' "$device_json")
echo "DETOX_AVD=${avd_name}" >> "$GITHUB_ENV"
- name: Android E2E Tests (latest)
run: devbox run --config=shells/devbox-android.json test-android
run: devbox run test-android
30 changes: 9 additions & 21 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
env:
YARN_ENABLE_HARDENED_MODE: 0
XCODE_VERSION: '26.2'
ANDROID_SKIP_DOWNLOADS: 1
strategy:
matrix:
include:
Expand Down Expand Up @@ -55,26 +56,21 @@ jobs:
- name: devbox installer
uses: jetify-com/devbox-install-action@v0.14.0
with:
project-path: shells/devbox-ios.json
enable-cache: 'false'
- name: Resolve iOS targets
run: |
. scripts/platform-versions.sh
if [ "${{ matrix.name }}" = "ios-min" ]; then
echo "DETOX_IOS_DEVICE=${PLATFORM_IOS_MIN_DEVICE}" >> "$GITHUB_ENV"
echo "IOS_RUNTIME=${PLATFORM_IOS_MIN_RUNTIME}" >> "$GITHUB_ENV"
else
echo "DETOX_IOS_DEVICE=${PLATFORM_IOS_MAX_DEVICE}" >> "$GITHUB_ENV"
echo "IOS_RUNTIME=${PLATFORM_IOS_MAX_RUNTIME}" >> "$GITHUB_ENV"
fi
target=${{ matrix.name == 'ios-min' && 'min' || 'max' }}
device_json="devbox.d/segment-integrations.devbox-plugins.ios/devices/${target}.json"
echo "DETOX_IOS_DEVICE=$(jq -r '.name' "$device_json")" >> "$GITHUB_ENV"
- name: iOS E2E Tests
run: devbox run --config=shells/devbox-ios.json test-ios
run: devbox run test-ios

e2e-android:
name: E2E Android (min/max)
runs-on: ubuntu-24.04-arm
env:
EMU_HEADLESS: 1
IOS_SKIP_SETUP: 1
strategy:
matrix:
include:
Expand Down Expand Up @@ -103,22 +99,14 @@ jobs:
- name: devbox installer
uses: jetify-com/devbox-install-action@v0.14.0
with:
project-path: shells/devbox-android.json
enable-cache: 'false'
- name: Resolve Android targets
run: |
. scripts/platform-versions.sh
if [ "${{ matrix.target }}" = "min" ]; then
api="$PLATFORM_ANDROID_MIN_API"
device="$PLATFORM_ANDROID_MIN_DEVICE"
else
api="$PLATFORM_ANDROID_MAX_API"
device="$PLATFORM_ANDROID_MAX_DEVICE"
fi
avd_name="${device}_API${api}_arm64_v8a"
device_json="devbox.d/segment-integrations.devbox-plugins.android/devices/${{ matrix.target }}.json"
avd_name=$(jq -r '.name' "$device_json")
echo "DETOX_AVD=${avd_name}" >> "$GITHUB_ENV"
- name: Android E2E Tests
run: devbox run --config=shells/devbox-android.json test-android
run: devbox run test-android

publish:
name: Publish to npm
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"devices": [
{
"name": "medium_phone_api36",
"api": 36,
"device": "medium_phone",
"tag": "google_apis"
},
{
"name": "pixel_api21",
"api": 21,
"device": "pixel",
"tag": "google_apis"
}
],
"checksum": "8df4d3393b61fbbb08e45cf8762f95c521316938e514527916e4fce88a849d57",
"generated_at": "2026-02-18T18:53:57Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "medium_phone_api36",
"api": 36,
"device": "medium_phone",
"tag": "google_apis"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "pixel_api21",
"api": 21,
"device": "pixel",
"tag": "google_apis"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"devices": [
{
"name": "iPhone 17",
"runtime": "26.2"
},
{
"name": "iPhone 13",
"runtime": "15.4"
}
],
"checksum": "4d5276f203d7ad62860bfc067f76194df53be449d4aa8a3b2d069855ec1f3232",
"generated_at": "2026-02-18T18:53:59Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "iPhone 17",
"runtime": "26.2"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "iPhone 13",
"runtime": "15.4"
}
99 changes: 23 additions & 76 deletions devbox.json
Original file line number Diff line number Diff line change
@@ -1,106 +1,53 @@
{
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.14.2/.schema/devbox.schema.json",
"include": [
"github:segment-integrations/devbox-plugins?dir=plugins/android",
"github:segment-integrations/devbox-plugins?dir=plugins/ios"
],
"packages": {
"cocoapods": {
"version": "latest",
"platforms": ["x86_64-darwin", "aarch64-darwin"]
},
"yarn-berry": "latest",
"treefmt": "latest",
"nixfmt": "latest",
"shfmt": "latest",
"jdk17": "latest",
"gradle": "latest",
"jq": "latest",
"netcat": "latest",
"path:./nix#android-sdk": ""
"shfmt": "latest"
},
"shell": {
"init_hook": [
"echo 'Welcome to analytics-react-native devbox!' > /dev/null",
". $DEVBOX_PROJECT_ROOT/scripts/shared/common.sh",
"if [ \"$(uname -s)\" = \"Darwin\" ]; then . $DEVBOX_PROJECT_ROOT/scripts/ios/env.sh; fi",
". $DEVBOX_PROJECT_ROOT/scripts/android/env.sh",
"echo 'Android SDK env configured (details: wiki/devbox.md#devbox-android).'"
],
"scripts": {
"clean": [
"rm -rf $DEVBOX_PROJECT_ROOT/examples/E2E/ios/Podfile.lock",
"rm -rf $DEVBOX_PROJECT_ROOT/examples/E2E/ios/Pods",
"cd $DEVBOX_PROJECT_DIR/examples/E2E/android && gradle clean",
"yarn cache clean",
"find $DEVBOX_PROJECT_DIR -type d -name node_modules -exec rmdir {} \\;"
],
"build": ["bash $SCRIPTS_DIR/build.sh"],
"build": ["yarn install --immutable", "yarn build", "yarn lint"],
"format": ["treefmt"],
"lint": ["treefmt --fail-on-change"],
"test-android": ["bash $SCRIPTS_DIR/android/test.sh"],
"test-ios": ["bash $SCRIPTS_DIR/ios/test.sh"],
"act-ci": [
"bash $SCRIPTS_DIR/act-ci.sh --platform ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-24.04"
"test-android": [
"yarn install",
"yarn e2e install",
"yarn build",
"yarn e2e build:android",
"yarn e2e test:android"
],
"test-ios": [
"yarn install",
"yarn e2e install",
"yarn e2e pods",
"yarn build",
"yarn e2e build:ios",
"yarn e2e test:ios"
],
"setup-android": ["bash $SCRIPTS_DIR/android/setup.sh"],
"setup-ios": ["bash $SCRIPTS_DIR/ios/setup.sh"],
"start-emulator": ["bash $SCRIPTS_DIR/android/manager.sh start"],
"start-ios": ["bash $SCRIPTS_DIR/ios/manager.sh start"],
"start-android-minsdk": ["bash $SCRIPTS_DIR/android/manager.sh start"],
"start-android-latest": [
"AVD_FLAVOR=latest bash $SCRIPTS_DIR/android/manager.sh start"
"act-ci": [
"bash $DEVBOX_PROJECT_ROOT/scripts/act-ci.sh --platform ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-24.04"
],
"start-android": ["bash $SCRIPTS_DIR/android/manager.sh start"],
"update-apps": [
"yarn install --no-immutable",
"yarn e2e install --no-immutable",
"yarn example install --no-immutable"
],
"update-shells": [
"devbox update",
"devbox update --config=shells/devbox-fast.json",
"devbox update --config=shells/devbox-android.json",
"devbox update --config=shells/devbox-ios.json"
],
"reset-android": [
"rm -rf ~/.android/avd",
"rm -f ~/.android/adbkey*",
"echo \"AVDs and adb keys removed. Recreate via devbox run start-android* as needed.\""
],
"reset-ios": [
"xcrun simctl shutdown all || true",
"xcrun simctl erase all || true",
"xcrun simctl delete all || true",
"xcrun simctl delete unavailable || true",
"killall -9 com.apple.CoreSimulatorService 2>/dev/null || true",
"echo \"Simulators reset via simctl. Recreate via devbox run start-ios.\""
],
"stop-android": [
"if command -v adb >/dev/null 2>&1; then",
" devices=$(adb devices -l 2>/dev/null | tail -n +2 | awk '{print $1}' | tr '\\n' ' ');",
" if [[ -n \"$devices\" ]]; then",
" echo \"Stopping Android emulators: $devices\";",
" for d in $devices; do adb -s \"$d\" emu kill >/dev/null 2>&1 || true; done;",
" else",
" echo \"No Android emulators detected via adb.\";",
" fi;",
"else",
" echo \"adb not found; skipping Android emulator shutdown.\";",
"fi",
"pkill -f \"emulator@\" >/dev/null 2>&1 || true",
"echo \"Android emulators stopped (if any were running).\""
],
"stop-ios": [
"if command -v xcrun >/dev/null 2>&1 && xcrun -f simctl >/dev/null 2>&1; then",
" if xcrun simctl list devices booted | grep -q \"Booted\"; then",
" echo \"Shutting down booted iOS simulators...\";",
" xcrun simctl shutdown all >/dev/null 2>&1 || true;",
" else",
" echo \"No booted iOS simulators detected.\";",
" fi;",
"else",
" echo \"simctl not available; skipping iOS shutdown.\";",
"fi",
"echo \"iOS simulators shutdown (if any were running).\""
"devbox update --config=shells/devbox-fast.json"
],
"stop": ["devbox run stop-android", "devbox run stop-ios"],
"test": ["devbox run test-android", "devbox run test-ios"]
}
}
Expand Down
Loading