Files
orca/.github/workflows/mobile-native-shell-tests.yml
T
Jinwoo-H f73817e2cb ci(mobile): run the native web shell store suites
The hybrid WebView branch's strongest tests were invoked by no workflow: 1,753
lines of Kotlin store tests behind a Gradle task nothing called, and 2,253 lines
of Swift store tests behind `pnpm --dir mobile test:native:ios-web-store`.

Both land in a workflow of their own because GitHub has no per-job `paths` and
neither toolchain belongs on mobile.yml's ubuntu verify job. The filter is the
module directory plus src/shared/mobile-web, so unrelated mobile PRs pay
nothing.

- android-unit-tests (ubuntu-latest): expo prebuild, then
  :orca-expo-mobile-web-shell:testDebugUnitTest. Autolinking names the project
  after the npm package, and the task is finalizedBy the process-interruption
  drill, so that runs too.
- ios-store-tests (macos-26, Xcode 26.5 to match mobile-ios-release.yml): the
  swiftc runner, which needs no simulator, no pods, and no node_modules.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
2026-09-01 16:36:45 -04:00

120 lines
3.8 KiB
YAML

name: Mobile Native Shell Tests
# Why a workflow of its own rather than jobs in mobile.yml: these two suites are
# the store/boundary tests for the hybrid WebView shell, and both need a
# toolchain mobile.yml's ubuntu verify job does not have (an Android SDK, a
# macOS Swift toolchain). GitHub has no per-job `paths`, so a separate workflow
# is the only way to keep a macOS runner and a Gradle build off every unrelated
# mobile PR.
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
paths:
- 'mobile/packages/expo-mobile-web-shell/**'
# Why: the Swift and Kotlin stores implement these manifest/package
# contracts, so a contract edit must re-run both native suites.
- 'src/shared/mobile-web/**'
- '.github/workflows/mobile-native-shell-tests.yml'
jobs:
android-unit-tests:
name: Android web shell unit tests
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
working-directory: mobile
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- name: Setup pnpm
uses: pnpm/setup@v2
with:
install: false
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Cache Gradle dependencies
uses: actions/cache@v5
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-web-shell-${{ runner.os }}-${{ hashFiles('mobile/pnpm-lock.yaml') }}
restore-keys: |
gradle-web-shell-${{ runner.os }}-
# Why prebuild: the module's build.gradle resolves ':expo-modules-core'
# through Expo autolinking, which only exists in the generated
# mobile/android project. The package directory has no settings.gradle or
# wrapper of its own, so there is no cheaper standalone Gradle build.
- name: Expo prebuild
run: npx expo prebuild --platform android --no-install
# Why this project name: autolinking derives it from the npm package name,
# so @orca/expo-mobile-web-shell becomes :orca-expo-mobile-web-shell.
# testDebugUnitTest is finalizedBy testDebugProcessInterruption, so the
# kill-mid-write drill runs here too.
- name: Run web shell unit tests
run: cd android && ./gradlew :orca-expo-mobile-web-shell:testDebugUnitTest
- name: Upload Gradle test report
if: failure()
uses: actions/upload-artifact@v7
with:
name: android-web-shell-test-report
path: mobile/packages/expo-mobile-web-shell/android/build/reports/tests/
if-no-files-found: ignore
retention-days: 7
ios-store-tests:
name: iOS mobile web store tests
# Same runner and Xcode as mobile-ios-release.yml, so these Swift sources are
# checked under the toolchain that actually builds the shipped app.
runs-on: macos-26
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Select Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '26.5'
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: package.json
- name: Setup pnpm
uses: pnpm/setup@v2
with:
install: false
# Why no dependency install: the runner is Node stdlib driving
# `xcrun swiftc` over the module's own Swift sources and nothing else. It
# needs no simulator and no CocoaPods, and finishes in seconds.
- name: Run iOS mobile web store tests
run: pnpm --dir mobile test:native:ios-web-store