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
5 changes: 5 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v5

- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 16.4

- name: Create working directory
run: mkdir -p ${{ env.WORKING_DIR }}

Expand Down
59 changes: 33 additions & 26 deletions .github/workflows/test-nitro-cli.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Test Nitro CLI - Generate & Build

# Minimal permissions for downloading artifacts from other runs
permissions:
contents: write
contents: read
actions: read

on:
Expand All @@ -18,15 +19,18 @@ concurrency:
jobs:
test-ios-build:
name: Test iOS Build - ${{ matrix.pm }} - ${{ matrix.package-type }} (${{ matrix.mode }})
if: github.event.workflow_run.conclusion == 'success'
runs-on: macOS-15
# Run on successful upstream, or when manually dispatched
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
runs-on: macOS-latest
strategy:
fail-fast: false
matrix:
pm: ['bun', 'yarn']
package-type: ['module', 'view']
mode: ['Debug', 'Release']
env:
WORKING_DIR: ${{ github.workspace }}/react-native-test-${{ matrix.package-type }}
SCHEME: ${{ matrix.package-type == 'module' && 'TestModuleExample' || 'TestViewExample' }}
steps:
- name: Create working directory
run: mkdir -p ${{ env.WORKING_DIR }}
Expand Down Expand Up @@ -57,14 +61,8 @@ jobs:
ruby-version: '3.2'
bundler-cache: true

- name: Setup pnpm
if: matrix.pm == 'pnpm'
uses: pnpm/action-setup@v4
with:
version: 10

- name: Setup Node.js
if: matrix.pm == 'yarn' || matrix.pm == 'pnpm'
if: matrix.pm == 'yarn'
uses: actions/setup-node@v4
with:
node-version: 22.x
Expand Down Expand Up @@ -95,6 +93,16 @@ jobs:
${{ matrix.pm }} run build
node post-script.js

- name: Cache CocoaPods
uses: actions/cache@v4
with:
path: |
~/.cocoapods/repos
${{ env.WORKING_DIR }}/example/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles(format('{0}/example/ios/Podfile.lock', env.WORKING_DIR)) }}
restore-keys: |
${{ runner.os }}-pods-

- name: Install CocoaPods dependencies
working-directory: ${{ env.WORKING_DIR }}/example
run: ${{ matrix.pm }} pod
Expand All @@ -106,18 +114,11 @@ jobs:
- name: Build iOS project
working-directory: ${{ env.WORKING_DIR }}/example/ios
run: |
# Get the correct scheme name based on package type
if [ "${{ matrix.package-type }}" == "module" ]; then
SCHEME="TestModuleExample"
else
SCHEME="TestViewExample"
fi

set -o pipefail && xcodebuild \
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
-derivedDataPath build -UseModernBuildSystem=YES \
-workspace "${SCHEME}.xcworkspace" \
-scheme "$SCHEME" \
-scheme "${SCHEME}" \
-sdk iphonesimulator \
-configuration ${{ matrix.mode }} \
-destination 'platform=iOS Simulator,name=iPhone 16' \
Expand All @@ -126,9 +127,11 @@ jobs:

test-android-build:
name: Test Android Build - ${{ matrix.pm }} - ${{ matrix.package-type }} (${{ matrix.mode }})
if: github.event.workflow_run.conclusion == 'success'
# Run on successful upstream, or when manually dispatched
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
Comment on lines 128 to 132
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Same artifact issue on Android manual runs.

Mirror the iOS fix: add event-guarded download steps and workflow_dispatch input usage.

-  if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
+  if: github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')

And apply the two-step download pattern as in Lines 38-46 for Lines 145-153.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
test-android-build:
name: Test Android Build - ${{ matrix.pm }} - ${{ matrix.package-type }} (${{ matrix.mode }})
if: github.event.workflow_run.conclusion == 'success'
# Run on successful upstream, or when manually dispatched
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
test-android-build:
name: Test Android Build - ${{ matrix.pm }} - ${{ matrix.package-type }} (${{ matrix.mode }})
# Run on successful upstream, or when manually dispatched
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
pm: ['bun', 'yarn']
package-type: ['module', 'view']
Expand All @@ -154,14 +157,8 @@ jobs:
echo "Package structure:"
find . -type f -name "*.json" -o -name "*.js" -o -name "*.ts" | head -20

- name: Setup pnpm
if: matrix.pm == 'pnpm'
uses: pnpm/action-setup@v4
with:
version: 10

- name: Setup Node.js
if: matrix.pm == 'yarn' || matrix.pm == 'pnpm'
if: matrix.pm == 'yarn'
uses: actions/setup-node@v4
with:
node-version: 22.x
Expand Down Expand Up @@ -203,6 +200,16 @@ jobs:
working-directory: ${{ env.WORKING_DIR }}/example/android
run: chmod +x ./gradlew

- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles(format('{0}/example/android/**/*.gradle*', env.WORKING_DIR)) }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Clean and generate codegen artifacts
working-directory: ${{ env.WORKING_DIR }}/example/android
run: |
Expand Down
12 changes: 12 additions & 0 deletions scripts/e2e-maestro.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,17 @@ if [ "$PLATFORM" == "ios" ]; then
# Check if xcpretty is available
if command -v xcpretty >/dev/null 2>&1; then
set -o pipefail && $buildCmd | xcpretty
if [ $? -ne 0 ]; then
echo "❌ iOS build failed!"
exit 1
fi
else
echo "⚠️ xcpretty not found. Install with: gem install xcpretty"
$buildCmd
if [ $? -ne 0 ]; then
echo "❌ iOS build failed!"
exit 1
fi
fi

# Launch the simulator if not already booted
Expand All @@ -92,6 +100,10 @@ else
# Build with optimizations and pretty output
echo "🔨 Building Android app..."
./gradlew assembleRelease --no-daemon --build-cache --parallel --console=rich
if [ $? -ne 0 ]; then
echo "❌ Android build failed!"
exit 1
fi
APK_PATH="app/build/outputs/apk/release/app-release.apk"

# Install the APK
Expand Down
Loading