Skip to content

fix(screen-orientation): resolve the window scene via the bridge view controller on iOS #1531

fix(screen-orientation): resolve the window scene via the bridge view controller on iOS

fix(screen-orientation): resolve the window scene via the bridge view controller on iOS #1531

Workflow file for this run

name: CI
on:
push:
branches:
- main
paths-ignore:
- "**.md"
- ".vscode/**"
pull_request:
paths-ignore:
- "**.md"
- ".vscode/**"
workflow_dispatch:
env:
NODE_VERSION: 24
JAVA_VERSION: 21
MAESTRO_VERSION: 2.5.1
TURBO_SCM_BASE: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
jobs:
build-android:
name: Build Android platform
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Set up Java ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}
- name: Install Node.js dependencies
run: npm ci
- name: Build packages affected by changes
if: github.ref != 'refs/heads/main'
run: npm run affected:verify:android
- name: Build all packages
if: github.ref == 'refs/heads/main'
run: npm run verify:android
build-ios:
name: Build iOS platform
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Install Node.js dependencies
run: npm ci
- name: Install CocoaPods dependencies of packages affected by changes
if: github.ref != 'refs/heads/main'
run: npm run affected:ios:pod:install
- name: Install all CocoaPods dependencies
if: github.ref == 'refs/heads/main'
run: npm run ios:pod:install
- name: Install SPM dependencies of packages affected by changes
if: github.ref != 'refs/heads/main'
run: npm run affected:ios:spm:install
- name: Install all SPM dependencies
if: github.ref == 'refs/heads/main'
run: npm run ios:spm:install
- name: Build packages affected by changes
if: github.ref != 'refs/heads/main'
run: npm run affected:verify:ios
- name: Build all packages
if: github.ref == 'refs/heads/main'
run: npm run verify:ios
build-web:
name: Build Web platform
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Set up Java ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}
- name: Install Node.js dependencies
run: npm ci
- name: Build packages affected by changes
if: github.ref != 'refs/heads/main'
run: npm run affected:verify:web
- name: Build all packages
if: github.ref == 'refs/heads/main'
run: npm run verify:web
lint:
name: Lint
runs-on: macos-15
needs: [build-android, build-ios, build-web]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: npm ci
- name: Lint packages affected by changes
if: github.ref != 'refs/heads/main'
run: npm run affected:lint
- name: Lint all packages
if: github.ref == 'refs/heads/main'
run: npm run lint
e2e-android:
name: E2E (Android)
runs-on: ubuntu-latest
needs: [build-android, build-web]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Set up Java ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}
- name: Install Node.js dependencies
run: npm ci
- name: Discover packages with e2e:android
id: pkgs
run: |
filter='.tasks[] | select(.command != "<NONEXISTENT>") | .directory'
if [ "$GITHUB_REF" = "refs/heads/main" ]; then
dirs=$(npx turbo run e2e:android --dry-run=json | jq -r "$filter" | tr '\n' ' ' | sed 's/[[:space:]]*$//')
else
dirs=$(npx turbo run e2e:android --affected --dry-run=json | jq -r "$filter" | tr '\n' ' ' | sed 's/[[:space:]]*$//')
fi
echo "dirs=$dirs" >> "$GITHUB_OUTPUT"
if [ -n "$dirs" ]; then
echo "has_pkgs=true" >> "$GITHUB_OUTPUT"
fi
- name: Enable KVM
if: steps.pkgs.outputs.has_pkgs == 'true'
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: Install Maestro
if: steps.pkgs.outputs.has_pkgs == 'true'
run: |
curl -Ls "https://get.maestro.mobile.dev" | MAESTRO_VERSION="${{ env.MAESTRO_VERSION }}" bash
echo "$HOME/.maestro/bin" >> $GITHUB_PATH
- name: Build example APKs
if: steps.pkgs.outputs.has_pkgs == 'true'
run: |
for dir in ${{ steps.pkgs.outputs.dirs }}; do
echo "::group::Building APK in $dir/example"
(
npm --prefix "$dir" run build
cd "$dir/example"
npm ci
npm run build
npx cap sync android
cd android && ./gradlew assembleDebug
)
echo "::endgroup::"
done
- name: Run e2e on emulator
if: steps.pkgs.outputs.has_pkgs == 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
target: aosp_atd
arch: x86_64
profile: pixel_6
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -no-boot-anim -camera-back none
disable-animations: true
script: |
for dir in ${{ steps.pkgs.outputs.dirs }}; do adb install -r "$dir/example/android/app/build/outputs/apk/debug/app-debug.apk"; done
if [ "$GITHUB_REF" = "refs/heads/main" ]; then npm run e2e:android; else npm run affected:e2e:android; fi
- name: Upload Maestro artifacts on failure
if: failure() && steps.pkgs.outputs.has_pkgs == 'true'
uses: actions/upload-artifact@v4
with:
name: maestro-android-${{ github.run_id }}
path: ~/.maestro/tests
e2e-ios:
name: E2E (iOS)
runs-on: macos-latest
needs: [build-ios, build-web]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Install Node.js dependencies
run: npm ci
- name: Discover packages with e2e:ios
id: pkgs
run: |
filter='.tasks[] | select(.command != "<NONEXISTENT>") | .directory'
dirs=$(npx turbo run e2e:ios --dry-run=json | jq -r "$filter" | tr '\n' ' ' | sed 's/[[:space:]]*$//')
echo "dirs=$dirs" >> "$GITHUB_OUTPUT"
if [ -n "$dirs" ]; then
echo "has_pkgs=true" >> "$GITHUB_OUTPUT"
fi
- name: Install Maestro
if: steps.pkgs.outputs.has_pkgs == 'true'
run: |
curl -Ls "https://get.maestro.mobile.dev" | MAESTRO_VERSION="${{ env.MAESTRO_VERSION }}" bash
echo "$HOME/.maestro/bin" >> $GITHUB_PATH
- name: Boot iOS simulator
if: steps.pkgs.outputs.has_pkgs == 'true'
run: |
UDID=$(xcrun simctl list devices available | grep -m1 -E 'iPhone .*\([0-9A-Fa-f-]{36}\)' | grep -oE '[0-9A-Fa-f-]{36}' || true)
if [ -z "$UDID" ]; then
echo "No available iPhone simulator found."
xcrun simctl list devices available
exit 1
fi
echo "SIM_UDID=$UDID" >> $GITHUB_ENV
xcrun simctl boot "$UDID"
xcrun simctl bootstatus "$UDID" -b
- name: Build and install example apps
if: steps.pkgs.outputs.has_pkgs == 'true'
run: |
for dir in ${{ steps.pkgs.outputs.dirs }}; do
echo "::group::Building .app in $dir/example"
(
npm --prefix "$dir" run build
cd "$dir/example"
npm ci
npm run build
npx cap sync ios
cd ios/App
xcodebuild -workspace App.xcworkspace -scheme App -configuration Debug \
-sdk iphonesimulator -destination "id=$SIM_UDID" -derivedDataPath build
xcrun simctl install "$SIM_UDID" build/Build/Products/Debug-iphonesimulator/App.app
)
echo "::endgroup::"
done
- name: Run e2e
if: steps.pkgs.outputs.has_pkgs == 'true'
run: npm run e2e:ios
- name: Upload Maestro artifacts on failure
if: failure() && steps.pkgs.outputs.has_pkgs == 'true'
uses: actions/upload-artifact@v4
with:
name: maestro-ios-${{ github.run_id }}
path: ~/.maestro/tests
release:
name: Release
runs-on: ubuntu-latest
needs: [lint]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: npm ci
- name: Build all packages
run: npm run verify:web
- name: Publish all packages
run: npm run release:preview