From 8459969a43d215c1c1292a16c463c4f4659d7095 Mon Sep 17 00:00:00 2001 From: Bartosz Hanc Date: Thu, 12 Nov 2026 15:45:16 +0100 Subject: [PATCH 1/7] ci: build clean consumers across compatible RN and Worklets versions --- .agents/skills/verify-and-build/SKILL.md | 8 + .github/consumer-builds/App.jsx | 20 ++ .github/consumer-builds/README.md | 123 ++++++++++++ .github/consumer-builds/compatibility.json | 66 +++++++ .github/consumer-builds/matrix.mjs | 144 ++++++++++++++ .github/consumer-builds/matrix.test.mjs | 113 +++++++++++ .github/consumer-builds/prepare.mjs | 207 +++++++++++++++++++++ .github/workflows/consumer-builds.yml | 204 ++++++++++++++++++++ 8 files changed, 885 insertions(+) create mode 100644 .github/consumer-builds/App.jsx create mode 100644 .github/consumer-builds/README.md create mode 100644 .github/consumer-builds/compatibility.json create mode 100644 .github/consumer-builds/matrix.mjs create mode 100644 .github/consumer-builds/matrix.test.mjs create mode 100644 .github/consumer-builds/prepare.mjs create mode 100644 .github/workflows/consumer-builds.yml diff --git a/.agents/skills/verify-and-build/SKILL.md b/.agents/skills/verify-and-build/SKILL.md index 4b641887dd..69eb1b54da 100644 --- a/.agents/skills/verify-and-build/SKILL.md +++ b/.agents/skills/verify-and-build/SKILL.md @@ -108,6 +108,14 @@ phoneme output. Use device/emulator integration for those behaviors. ## Native app verification +The [consumer build matrix](../../../.github/consumer-builds/README.md) checks a +packed library in fresh bare RN and Expo applications on Android and iOS. It +runs the full compatibility matrix on relevant PRs and supports manual dispatch. +Use it for publication, installation, autolinking, release bundling and +native build regressions. It does not launch applications or +establish device inference. The linked README owns its version pins, commands, +artifacts and limitations. + Choose the relevant app (`computer-vision`, `nlp` or `speech`) and inspect its current native setup. Provision matching native libraries before rebuilding. If iOS native projects already exist, run `pod install` in the app's `ios/` directory when dependencies, podspec files or source discovery change. diff --git a/.github/consumer-builds/App.jsx b/.github/consumer-builds/App.jsx new file mode 100644 index 0000000000..0a789aba34 --- /dev/null +++ b/.github/consumer-builds/App.jsx @@ -0,0 +1,20 @@ +import React from 'react'; +import { SafeAreaView, Text } from 'react-native'; +import { tensor } from 'react-native-executorch'; + +// Release bundling must resolve the published JS entry point and transform +// worklets. This fixture is build coverage; CI does not launch it or run a model. +function buildMarker() { + 'worklet'; + return 'Consumer build'; +} + +export default function App() { + return ( + + + {buildMarker()}: {typeof tensor} + + + ); +} diff --git a/.github/consumer-builds/README.md b/.github/consumer-builds/README.md new file mode 100644 index 0000000000..0392de868c --- /dev/null +++ b/.github/consumer-builds/README.md @@ -0,0 +1,123 @@ +# Consumer build matrix + + + +The [Consumer builds workflow](../workflows/consumer-builds.yml) installs one +published-format library tarball into fresh consumer applications outside the +checkout. All cells use the same tarball built from the current commit. They +cannot resolve the repository's workspace dependencies or library source files. + +## Version coverage + +[compatibility.json](./compatibility.json) declares supported RN minors for each +pinned Worklets release, pinned RN patches and peer versions, and the Expo +fixture. [matrix.mjs](./matrix.mjs) generates every declared compatible pair and +expands it across Android and iOS. One workflow plans, packs and builds them. + +| React Native | Compatible Worklets pins | Release app builds | +| ------------------------ | ---------------------------------------------------------- | ------------------ | +| 0.83.6 | 0.10.4, 0.11.4, 0.12.2 | 6 | +| 0.84.1 | 0.10.4, 0.11.4, 0.12.2 | 6 | +| 0.85.3 | 0.10.4, 0.11.4, 0.12.2 | 6 | +| 0.86.3 | 0.10.4, 0.11.4, 0.12.2, 0.13.0 | 8 | +| 0.87.1 | 0.12.2, 0.13.0 | 4 | +| 0.88.1 | 0.13.0 | 2 | +| Expo 57.0.28 / RN 0.86.3 | 0.13.0 | 2 | +| **Total** | **16 bare pairs + 1 Expo fixture, each on both platforms** | **34** | + +- **Relevant pull requests:** all 34 app builds per run, 17 Android and 17 iOS. + Path filters select library, harness, workflow and dependency changes targeting + `main`. +- **Manual dispatch:** `full` runs 34 app builds; `pr` runs the four boundary + builds (RN 0.83.6 / Worklets 0.10.4 and RN 0.88.1 / Worklets 0.13.0, each on both + platforms). +- **No scheduled runs yet.** A TODO in the workflow tracks moving the full matrix + to a nightly cron job and restoring boundary-only PR coverage after validation. + +Every full run also has one planning/test job and one shared library build/package +job: **36 jobs total**, with at most four app builds concurrently. The optional +manual boundary run has six jobs total. + +The compatibility rules match the pinned Worklets packages' published RN peer +ranges. For example, Worklets 0.13 supports RN 0.86–0.88, whereas 0.12 supports +0.83–0.87. Every compatible combination of the declared pins is built on relevant PRs; +this does not test every patch release or expand support to Worklets 0.14. +blob-util is pinned to 0.25.1 for RN 0.83 and 1.0.0 for newer RN versions, because +blob-util 1.0 requires RN >=0.84. + +All builds are Release: Android uses Ubuntu 24.04, Java 17, arm64 and R8; iOS uses +an Apple Silicon macOS 26 runner and creates an unsigned device archive. Framework +linkage, backend subsets, Debug, RN nightly and other Expo SDKs are separate +coverage to add, not extra dimensions of this matrix. + +## What it checks + +- The publishing script packs built JavaScript, declarations, native sources and + the license, without bundling dependencies or downloaded native artifacts. +- npm installs the tarball and executes the real native-library postinstall hook. +- Bare RN and Expo autolinking, Worklets Babel configuration, native compilation, + release JS bundling, and Android R8 complete successfully. +- APKs contain arm64 RNE, ExecuTorch, XNNPACK and Vulkan shared libraries. +- iOS archives contain the application executable and JS bundle. When the package + ships its privacy manifest, the resource bundle must appear in the archive and + pass `plutil` validation. + +All optional native libraries for the selected platform are enabled. Postinstall +fetches only that platform via `RNET_TARGET`. This does not test cross-host Expo +fingerprint equality or backend opt-outs. + +The workflow does not launch apps, run models, validate App Store uploads or test +EAS/OTA. A passing build does not establish successful device inference. + +## Run locally + +Use Node from `.nvmrc`, the repository's Yarn version, and the toolchains in the +[verification skill](../../.agents/skills/verify-and-build/SKILL.md). From the +repository root: + +```bash +RNET_SKIP_DOWNLOAD=1 yarn install --immutable +(cd packages/react-native-executorch && RNET_SKIP_DOWNLOAD=1 RNE_SKIP_INSTALL=1 GIT_LFS_SKIP_SMUDGE=1 ./scripts/create-package.sh) + +# Use a new directory outside the checkout. Leave RNET_SKIP_DOWNLOAD unset. +node .github/consumer-builds/prepare.mjs rn-0-83-worklets-0-10 android \ + packages/react-native-executorch/react-native-executorch-1.0.0.tgz \ + /tmp/ConsumerBuild + +cd /tmp/ConsumerBuild/android +./gradlew :app:assembleRelease --no-daemon --stacktrace --max-workers=2 +``` + +Adjust the tarball filename to the package version. For iOS, pass `ios` instead +of `android`, run `pod install` in the generated `ios/` directory, then use the +workflow's archive command. `expo-57` works on either platform. iOS app +deployment targets are at least 17.0, preserving a higher RN requirement. + +Compatibility data pins the framework, Worklets, blob-util and CLI; other template and +transitive dependencies are resolved on each run. Every cell retains its resolved +profile, npm lockfile, Gradle files, Podfile configuration and lockfile when present, native +library configuration and logs in a seven-day artifact. Android artifacts also +contain the APK; full iOS archives are not uploaded. No successful-build marker +cache skips compilation of a new library commit. + +## Maintain the matrix + +Update the JSON pins and compatibility declarations deliberately, checking the +published npm peer requirements. Every configured RN minor must have a compatible +Worklets version, every Worklets RN declaration must name a configured RN minor, +and Expo must use a declared compatible pair. The tests verify full combination +coverage, unique artifact ids, and manual boundary selection. The planning job reports +the actual build count in the GitHub job summary; update the table and expected +counts in the tests when changing support. + +```bash +node --test .github/consumer-builds/matrix.test.mjs +node .github/consumer-builds/matrix.mjs full +node --check .github/consumer-builds/prepare.mjs +actionlint .github/workflows/consumer-builds.yml +yarn prettier --ignore-path /dev/null --check '.github/consumer-builds/*' '.github/workflows/consumer-build*.yml' +``` + +Exercise preparation and the affected platform build after changing templates or +build commands. `.github` is excluded by the repository's default Prettier ignore +file, so formatting these files needs `--ignore-path /dev/null`. diff --git a/.github/consumer-builds/compatibility.json b/.github/consumer-builds/compatibility.json new file mode 100644 index 0000000000..99a45bdf72 --- /dev/null +++ b/.github/consumer-builds/compatibility.json @@ -0,0 +1,66 @@ +{ + "cli": "20.1.1", + "bare": [ + { + "id": "rn-0-83", + "reactNative": "0.83.6", + "blobUtil": "0.25.1" + }, + { + "id": "rn-0-84", + "reactNative": "0.84.1", + "blobUtil": "1.0.0" + }, + { + "id": "rn-0-85", + "reactNative": "0.85.3", + "blobUtil": "1.0.0" + }, + { + "id": "rn-0-86", + "reactNative": "0.86.3", + "blobUtil": "1.0.0" + }, + { + "id": "rn-0-87", + "reactNative": "0.87.1", + "blobUtil": "1.0.0" + }, + { + "id": "rn-0-88", + "reactNative": "0.88.1", + "blobUtil": "1.0.0" + } + ], + "expo": [ + { + "id": "expo-57", + "expo": "57.0.28", + "reactNative": "0.86.3", + "react": "19.2.3", + "worklets": "0.13.0", + "blobUtil": "1.0.0", + "buildProperties": "57.0.22", + "babelPreset": "57.0.15", + "babelCore": "7.29.7" + } + ], + "worklets": [ + { + "version": "0.10.4", + "reactNative": ["0.83", "0.84", "0.85", "0.86"] + }, + { + "version": "0.11.4", + "reactNative": ["0.83", "0.84", "0.85", "0.86"] + }, + { + "version": "0.12.2", + "reactNative": ["0.83", "0.84", "0.85", "0.86", "0.87"] + }, + { + "version": "0.13.0", + "reactNative": ["0.86", "0.87", "0.88"] + } + ] +} diff --git a/.github/consumer-builds/matrix.mjs b/.github/consumer-builds/matrix.mjs new file mode 100644 index 0000000000..f486daf725 --- /dev/null +++ b/.github/consumer-builds/matrix.mjs @@ -0,0 +1,144 @@ +import { appendFileSync, readFileSync } from 'node:fs'; +import { pathToFileURL } from 'node:url'; + +const minor = (version) => version.split('.').slice(0, 2).join('.'); +const compareVersions = (left, right) => { + const a = left.split('.').map(Number); + const b = right.split('.').map(Number); + return a[0] - b[0] || a[1] - b[1] || a[2] - b[2]; +}; + +export function readCompatibility() { + return JSON.parse(readFileSync(new URL('./compatibility.json', import.meta.url), 'utf8')); +} + +export function createProfiles(config = readCompatibility()) { + const pinned = /^\d+\.\d+\.\d+$/; + const ids = new Set(); + const requireVersion = (version, label) => { + if (!pinned.test(version)) throw new Error(`Pin ${label} to an exact version`); + }; + const requireId = (id) => { + if (typeof id !== 'string' || !/^[a-z0-9-]+$/.test(id) || ids.has(id)) { + throw new Error(`Invalid or duplicate profile id: ${id}`); + } + ids.add(id); + }; + requireVersion(config.cli, 'the scaffolding CLI'); + for (const key of ['bare', 'worklets', 'expo']) { + if (!Array.isArray(config[key]) || !config[key].length) + throw new Error(`No ${key} compatibility entries`); + } + const rnMinors = new Set(); + for (const rn of config.bare) { + requireVersion(rn.reactNative, `${rn.id}.reactNative`); + requireVersion(rn.blobUtil, `${rn.id}.blobUtil`); + if (rnMinors.has(minor(rn.reactNative))) + throw new Error(`Duplicate RN minor: ${rn.reactNative}`); + rnMinors.add(minor(rn.reactNative)); + requireId(rn.id); + } + const workletsMinors = new Set(); + for (const worklets of config.worklets) { + requireVersion(worklets.version, 'Worklets'); + if (workletsMinors.has(minor(worklets.version))) + throw new Error(`Duplicate Worklets minor: ${worklets.version}`); + workletsMinors.add(minor(worklets.version)); + if (!Array.isArray(worklets.reactNative) || !worklets.reactNative.length) + throw new Error(`No RN support for Worklets ${worklets.version}`); + const declared = new Set(); + for (const rn of worklets.reactNative) { + if (!rnMinors.has(rn) || declared.has(rn)) + throw new Error(`Invalid RN declaration ${rn} for Worklets ${worklets.version}`); + declared.add(rn); + } + } + const bare = [...config.bare] + .sort((a, b) => compareVersions(a.reactNative, b.reactNative)) + .flatMap((rn) => { + const compatible = config.worklets + .filter((worklets) => worklets.reactNative.includes(minor(rn.reactNative))) + .sort((a, b) => compareVersions(a.version, b.version)); + if (!compatible.length) throw new Error(`No compatible Worklets for ${rn.id}`); + return compatible.map((worklets) => { + const id = `${rn.id}-worklets-${minor(worklets.version).replaceAll('.', '-')}`; + requireId(id); + return { ...rn, id, worklets: worklets.version, family: 'bare', cli: config.cli }; + }); + }); + const expo = config.expo.map((profile) => { + requireId(profile.id); + for (const key of [ + 'reactNative', + 'worklets', + 'blobUtil', + 'expo', + 'react', + 'buildProperties', + 'babelPreset', + 'babelCore', + ]) { + requireVersion(profile[key], `${profile.id}.${key}`); + } + if ( + !config.worklets.some( + (worklets) => + worklets.version === profile.worklets && + worklets.reactNative.includes(minor(profile.reactNative)) + ) + ) { + throw new Error(`Unsupported Expo RN/Worklets pair: ${profile.id}`); + } + return { ...profile, family: 'expo', cli: config.cli }; + }); + return { bare, expo }; +} + +export function findProfile(id) { + const { bare, expo } = createProfiles(); + const profile = [...bare, ...expo].find((profile) => profile.id === id); + if (!profile) throw new Error(`Unknown consumer profile: ${id}`); + return profile; +} + +export function createMatrix(scope, config = readCompatibility()) { + if (!['pr', 'full'].includes(scope)) throw new Error(`Unknown matrix scope: ${scope}`); + const { bare, expo } = createProfiles(config); + // Sorting in createProfiles makes these the oldest and newest declared valid + // RN/Worklets pairs, independent of the order in the JSON file. + const boundaries = [...new Set([bare[0], bare.at(-1)])]; + const profiles = scope === 'full' ? [...bare, ...expo] : boundaries; + return { + scope, + matrix: { + include: profiles.flatMap((profile) => + ['android', 'ios'].map((platform) => ({ + profile: profile.id, + platform, + id: `${profile.id}-${platform}`, + })) + ), + }, + }; +} + +if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) { + const result = createMatrix(process.argv[2] ?? 'full'); + console.log(JSON.stringify(result, null, 2)); + if (process.env.GITHUB_OUTPUT) { + for (const [key, value] of Object.entries(result)) { + appendFileSync( + process.env.GITHUB_OUTPUT, + `${key}=${typeof value === 'string' ? value : JSON.stringify(value)}\n` + ); + } + } + if (process.env.GITHUB_STEP_SUMMARY) { + const counts = { android: 0, ios: 0 }; + for (const cell of result.matrix.include) counts[cell.platform]++; + appendFileSync( + process.env.GITHUB_STEP_SUMMARY, + `### Consumer build matrix (${result.scope})\n\n${result.matrix.include.length} Release app builds: ${counts.android} Android and ${counts.ios} iOS. One additional job packs the shared library.\n` + ); + } +} diff --git a/.github/consumer-builds/matrix.test.mjs b/.github/consumer-builds/matrix.test.mjs new file mode 100644 index 0000000000..f178214c3c --- /dev/null +++ b/.github/consumer-builds/matrix.test.mjs @@ -0,0 +1,113 @@ +import assert from 'node:assert/strict'; +import { execFileSync } from 'node:child_process'; +import { mkdtempSync, readFileSync, rmSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; +import { test } from 'node:test'; +import { fileURLToPath } from 'node:url'; +import { createMatrix, createProfiles, findProfile, readCompatibility } from './matrix.mjs'; + +test('boundary scope builds the oldest and newest RN profiles on both platforms', () => { + const { matrix } = createMatrix('pr'); + assert.deepEqual( + matrix.include.map((cell) => cell.id), + [ + 'rn-0-83-worklets-0-10-android', + 'rn-0-83-worklets-0-10-ios', + 'rn-0-88-worklets-0-13-android', + 'rn-0-88-worklets-0-13-ios', + ] + ); +}); + +test('the full matrix builds every declared compatible pair on both platforms', () => { + const { matrix } = createMatrix('full'); + const { bare, expo } = createProfiles(); + assert.equal(bare.length, 16); + assert.equal(matrix.include.length, 34); + assert.equal(matrix.include.filter((cell) => cell.profile.startsWith('expo-')).length, 2); + const expected = { + 0.83: ['0.10', '0.11', '0.12'], + 0.84: ['0.10', '0.11', '0.12'], + 0.85: ['0.10', '0.11', '0.12'], + 0.86: ['0.10', '0.11', '0.12', '0.13'], + 0.87: ['0.12', '0.13'], + 0.88: ['0.13'], + }; + const minor = (version) => version.split('.').slice(0, 2).join('.'); + for (const [rn, worklets] of Object.entries(expected)) { + assert.deepEqual( + bare.filter((p) => minor(p.reactNative) === rn).map((p) => minor(p.worklets)), + worklets + ); + } + for (const profile of [...bare, ...expo]) { + assert.deepEqual( + matrix.include.filter((cell) => cell.profile === profile.id).map((cell) => cell.platform), + ['android', 'ios'] + ); + } +}); + +test('boundary selection does not depend on JSON entry ordering', () => { + const config = readCompatibility(); + config.bare.reverse(); + config.worklets.reverse(); + assert.deepEqual(createMatrix('pr', config), createMatrix('pr')); +}); + +test('invalid declarations fail instead of silently dropping compatibility coverage', () => { + const unknown = readCompatibility(); + unknown.worklets[0].reactNative.push('0.89'); + assert.throws(() => createProfiles(unknown), /Invalid RN declaration/); + const uncovered = readCompatibility(); + for (const worklets of uncovered.worklets) + worklets.reactNative = worklets.reactNative.filter((rn) => rn !== '0.83'); + assert.throws(() => createProfiles(uncovered), /No compatible Worklets for rn-0-83/); + const expo = readCompatibility(); + expo.expo[0].worklets = '0.14.0'; + assert.throws(() => createProfiles(expo), /Unsupported Expo RN\/Worklets pair/); +}); + +test('each artifact id is unique across bare and Expo cells', () => { + const { matrix } = createMatrix('full'); + const ids = matrix.include.map((cell) => cell.id); + assert.equal(new Set(ids).size, ids.length); +}); + +test('profile lookup supplies its family and pinned CLI, and rejects typos', () => { + assert.equal(findProfile('rn-0-83-worklets-0-10').family, 'bare'); + assert.equal(findProfile('expo-57').family, 'expo'); + assert.match(findProfile('rn-0-88-worklets-0-13').cli, /^\d+\.\d+\.\d+$/); + assert.throws(() => findProfile('rn-0-89'), /Unknown consumer profile/); + assert.throws(() => createMatrix('typo'), /Unknown matrix scope/); +}); + +test('the CLI writes single-line JSON matrices usable by GitHub job outputs', () => { + const directory = mkdtempSync(join(tmpdir(), 'rnet-matrix-outputs-')); + const output = join(directory, 'outputs'); + const summary = join(directory, 'summary'); + try { + execFileSync( + process.execPath, + [fileURLToPath(new URL('./matrix.mjs', import.meta.url)), 'pr'], + { + env: { ...process.env, GITHUB_OUTPUT: output, GITHUB_STEP_SUMMARY: summary }, + } + ); + const outputs = Object.fromEntries( + readFileSync(output, 'utf8') + .trim() + .split('\n') + .map((line) => { + const separator = line.indexOf('='); + return [line.slice(0, separator), line.slice(separator + 1)]; + }) + ); + assert.equal(outputs.scope, 'pr'); + assert.equal(JSON.parse(outputs.matrix).include.length, 4); + assert.match(readFileSync(summary, 'utf8'), /4 Release app builds: 2 Android and 2 iOS/); + } finally { + rmSync(directory, { recursive: true, force: true }); + } +}); diff --git a/.github/consumer-builds/prepare.mjs b/.github/consumer-builds/prepare.mjs new file mode 100644 index 0000000000..0a464cef08 --- /dev/null +++ b/.github/consumer-builds/prepare.mjs @@ -0,0 +1,207 @@ +import { spawnSync } from 'node:child_process'; +import { + copyFileSync, + existsSync, + mkdirSync, + readFileSync, + realpathSync, + statSync, + writeFileSync, +} from 'node:fs'; +import { basename, dirname, isAbsolute, join, relative, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { findProfile } from './matrix.mjs'; + +const fixtures = dirname(fileURLToPath(import.meta.url)); +const repository = resolve(fixtures, '../..'); +const [profileId, platform, archiveArgument, directoryArgument] = process.argv.slice(2); +if ( + !['android', 'ios'].includes(platform) || + !profileId || + !archiveArgument || + !directoryArgument +) { + throw new Error( + 'Usage: node .github/consumer-builds/prepare.mjs android|ios ' + ); +} +const profile = findProfile(profileId); +const archive = realpathSync(archiveArgument); +const requestedDirectory = resolve(directoryArgument); +if (!statSync(archive).isFile() || !archive.endsWith('.tgz')) { + throw new Error('The library must be a packed .tgz file, not a workspace or symlinked directory'); +} +// npm must not discover the repository's workspaces or hoisted dependencies. +mkdirSync(dirname(requestedDirectory), { recursive: true }); +const directory = join(realpathSync(dirname(requestedDirectory)), basename(requestedDirectory)); +const fromRepository = relative(repository, directory); +if (fromRepository === '' || (!fromRepository.startsWith('../') && !isAbsolute(fromRepository))) { + throw new Error('Create the consumer outside the repository to avoid workspace resolution'); +} +if (existsSync(directory)) throw new Error(`Refusing to overwrite ${directory}`); +if (process.env.RNET_SKIP_DOWNLOAD) + throw new Error('Unset RNET_SKIP_DOWNLOAD: this test exercises the real postinstall'); + +function run(command, args, cwd) { + console.log(`Running ${command} ${args.join(' ')} in ${cwd}`); + const result = spawnSync(command, args, { cwd, stdio: 'inherit', env: process.env }); + if (result.error) throw result.error; + if (result.status !== 0) throw new Error(`${command} failed (${result.status ?? result.signal})`); +} + +function replaceInFile(path, pattern, replacement) { + const original = readFileSync(path, 'utf8'); + if (!pattern.test(original)) + throw new Error(`Template changed: cannot find ${pattern} in ${path}`); + writeFileSync(path, original.replace(pattern, replacement)); +} + +let manifest; +if (profile.family === 'bare') { + run( + 'npx', + [ + '--yes', + `@react-native-community/cli@${profile.cli}`, + 'init', + 'ConsumerBuild', + '--version', + profile.reactNative, + '--skip-install', + '--skip-git-init', + '--install-pods', + 'false', + '--directory', + directory, + ], + dirname(directory) + ); + manifest = JSON.parse(readFileSync(join(directory, 'package.json'), 'utf8')); + Object.assign(manifest.dependencies, { + 'react-native-worklets': profile.worklets, + // blob-util 1.0 requires RN >=0.84. Exercise the supported RN floor here. + 'react-native-blob-util': profile.blobUtil, + }); + writeFileSync( + join(directory, 'babel.config.js'), + `module.exports = { + presets: ['module:@react-native/babel-preset'], + plugins: ['react-native-worklets/plugin'], +}; +` + ); + writeFileSync( + join(directory, 'index.js'), + `import {AppRegistry} from 'react-native'; +import App from './App'; +AppRegistry.registerComponent('ConsumerBuild', () => App); +` + ); + // Replace the template's App.tsx so Metro bundles this fixture. + copyFileSync(join(fixtures, 'App.jsx'), join(directory, 'App.tsx')); + replaceInFile( + join(directory, 'ios/Podfile'), + /^platform :ios, min_ios_version_supported$/m, + "platform :ios, [Gem::Version.new(min_ios_version_supported), Gem::Version.new('17.0')].max.to_s" + ); + if (platform === 'android') { + replaceInFile( + join(directory, 'android/build.gradle'), + /minSdkVersion = \d+/, + 'minSdkVersion = 26' + ); + replaceInFile( + join(directory, 'android/gradle.properties'), + /^reactNativeArchitectures=.*$/m, + 'reactNativeArchitectures=arm64-v8a' + ); + replaceInFile( + join(directory, 'android/app/build.gradle'), + /def enableProguardInReleaseBuilds = false/, + 'def enableProguardInReleaseBuilds = true' + ); + } +} else { + mkdirSync(directory); + manifest = { + name: 'consumer-build', + version: '1.0.0', + private: true, + main: 'index.js', + dependencies: { + 'expo': profile.expo, + 'react': profile.react, + 'react-native': profile.reactNative, + 'expo-build-properties': profile.buildProperties, + 'react-native-worklets': profile.worklets, + 'react-native-blob-util': profile.blobUtil, + }, + devDependencies: { '@babel/core': profile.babelCore, 'babel-preset-expo': profile.babelPreset }, + }; + writeFileSync( + join(directory, 'app.json'), + JSON.stringify( + { + expo: { + name: 'ConsumerBuild', + slug: 'consumer-build', + version: '1.0.0', + ios: { bundleIdentifier: 'com.swmansion.executorch.consumerbuild' }, + android: { package: 'com.swmansion.executorch.consumerbuild' }, + plugins: [ + [ + 'expo-build-properties', + { + ios: { deploymentTarget: '17.0' }, + android: { + minSdkVersion: 26, + buildArchs: ['arm64-v8a'], + enableMinifyInReleaseBuilds: true, + }, + }, + ], + ], + }, + }, + null, + 2 + ) + '\n' + ); + writeFileSync( + join(directory, 'index.js'), + `import {registerRootComponent} from 'expo'; +import App from './App'; +registerRootComponent(App); +` + ); + copyFileSync(join(fixtures, 'App.jsx'), join(directory, 'App.jsx')); +} +copyFileSync(archive, join(directory, 'react-native-executorch.tgz')); +manifest.dependencies['react-native-executorch'] = 'file:./react-native-executorch.tgz'; +writeFileSync(join(directory, 'package.json'), JSON.stringify(manifest, null, 2) + '\n'); + +// Restrict downloads to this cell's platform, but keep all its optional native +// libraries enabled. No cache of extracted node_modules is shared between apps. +writeFileSync( + join(directory, 'consumer-profile.json'), + JSON.stringify({ ...profile, platform }, null, 2) + '\n' +); +process.env.RNET_TARGET = platform === 'android' ? 'android-arm64-v8a' : 'ios'; +run('npm', ['install', '--foreground-scripts', '--no-audit', '--no-fund'], directory); +const installed = join(directory, 'node_modules/react-native-executorch'); +if (realpathSync(installed) !== installed) + throw new Error('Consumer installed a linked workspace instead of the tarball'); +for (const file of [ + 'lib/module/index.js', + 'lib/typescript/src/index.d.ts', + 'rne-build-config.json', +]) { + if (!existsSync(join(installed, file))) throw new Error(`Installed package is missing ${file}`); +} +if (profile.family === 'expo') { + run( + 'npx', + ['--no-install', 'expo', 'prebuild', '--platform', platform, '--no-install'], + directory + ); +} diff --git a/.github/workflows/consumer-builds.yml b/.github/workflows/consumer-builds.yml new file mode 100644 index 0000000000..19cf4494fd --- /dev/null +++ b/.github/workflows/consumer-builds.yml @@ -0,0 +1,204 @@ +name: Consumer builds + +on: + pull_request: + branches: [main] + paths: + - '.github/workflows/consumer-build*.yml' + - '.github/consumer-builds/**' + - '.github/actions/setup/**' + - 'packages/react-native-executorch/**' + - 'package.json' + - 'yarn.lock' + - '.nvmrc' + workflow_dispatch: + inputs: + scope: + description: Version coverage + type: choice + options: [full, pr] + default: full + # TODO: After validating the full matrix on PRs, move it to a nightly cron + # job and restore the four boundary builds for pull_request events. + # schedule: + # - cron: '17 4 * * *' + +permissions: + contents: read + +concurrency: + group: consumer-builds-${{ github.ref }} + cancel-in-progress: true + +jobs: + plan: + runs-on: ubuntu-24.04 + timeout-minutes: 5 + outputs: + matrix: ${{ steps.matrix.outputs.matrix }} + scope: ${{ steps.matrix.outputs.scope }} + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 + with: + node-version-file: .nvmrc + - name: Validate consumer harness + run: | + node --check .github/consumer-builds/prepare.mjs + node --test .github/consumer-builds/matrix.test.mjs + - name: Generate version matrices + id: matrix + env: + MATRIX_SCOPE: ${{ inputs.scope || 'full' }} + run: node .github/consumer-builds/matrix.mjs "$MATRIX_SCOPE" + + package: + needs: plan + runs-on: ubuntu-24.04 + timeout-minutes: 25 + env: + RNET_SKIP_DOWNLOAD: '1' + RNE_SKIP_INSTALL: '1' + GIT_LFS_SKIP_SMUDGE: '1' + steps: + - uses: actions/checkout@v6 + - uses: ./.github/actions/setup + - name: Build the same tarball used for publishing + working-directory: packages/react-native-executorch + run: ./scripts/create-package.sh + - name: Check and stage the published files + run: | + listing=packages/react-native-executorch/build.log + grep -Fx 'package/lib/module/index.js' "$listing" + grep -Fx 'package/lib/typescript/src/index.d.ts' "$listing" + grep -Fx 'package/third-party/common/phonemis/phonemis_sources.rb' "$listing" + grep -Fx 'package/LICENSE' "$listing" + if grep -E '^package/(node_modules/|third-party/(include/|android/libs/|ios/libs/))' "$listing"; then + echo 'Package contains dependencies or downloaded native artifacts' >&2 + exit 1 + fi + cp packages/react-native-executorch/react-native-executorch-*.tgz "$RUNNER_TEMP/react-native-executorch.tgz" + - uses: actions/upload-artifact@v4 + with: + name: consumer-library + path: ${{ runner.temp }}/react-native-executorch.tgz + if-no-files-found: error + retention-days: 3 + + build: + needs: [plan, package] + name: ${{ matrix.id }} + strategy: + fail-fast: false + max-parallel: 4 + matrix: ${{ fromJSON(needs.plan.outputs.matrix) }} + runs-on: ${{ matrix.platform == 'ios' && 'macos-26' || 'ubuntu-24.04' }} + timeout-minutes: 90 + defaults: + run: + shell: bash + env: + CI: '1' + EXPO_NO_TELEMETRY: '1' + steps: + - name: Set consumer paths + run: | + echo "CONSUMER_DIR=$RUNNER_TEMP/ConsumerBuild" >> "$GITHUB_ENV" + echo "LOG_DIR=$RUNNER_TEMP/consumer-logs" >> "$GITHUB_ENV" + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 + with: + node-version-file: .nvmrc + - uses: actions/download-artifact@v4 + with: + name: consumer-library + path: ${{ runner.temp }}/consumer-package + - name: Record toolchain + run: | + mkdir -p "$LOG_DIR" + { + uname -a + node --version + npm --version + if [[ "$RUNNER_OS" == macOS ]]; then + test "$(uname -m)" = arm64 + xcodebuild -version + ruby --version + pod --version + fi + } 2>&1 | tee "$LOG_DIR/toolchain.log" + - uses: actions/setup-java@v4 + if: matrix.platform == 'android' + with: + distribution: temurin + java-version: '17' + - uses: android-actions/setup-android@v3 + if: matrix.platform == 'android' + - name: Record Android toolchain + if: matrix.platform == 'android' + run: | + { + java -version + sdkmanager --version + } 2>&1 | tee -a "$LOG_DIR/toolchain.log" + - name: Create and install the clean consumer + run: | + node .github/consumer-builds/prepare.mjs '${{ matrix.profile }}' '${{ matrix.platform }}' \ + "$RUNNER_TEMP/consumer-package/react-native-executorch.tgz" "$CONSUMER_DIR" \ + 2>&1 | tee "$LOG_DIR/install.log" + - name: Build Android release with R8 + if: matrix.platform == 'android' + working-directory: ${{ env.CONSUMER_DIR }}/android + run: | + ./gradlew :app:assembleRelease --no-daemon --stacktrace --max-workers=2 \ + 2>&1 | tee "$LOG_DIR/android.log" + apk=app/build/outputs/apk/release/app-release.apk + unzip -l "$apk" | tee "$LOG_DIR/apk-files.log" + for library in RnExecutorch executorch xnnpack_executorch_backend vulkan_executorch_backend; do + grep -F "lib/arm64-v8a/lib${library}.so" "$LOG_DIR/apk-files.log" + done + cp "$apk" "$LOG_DIR/ConsumerBuild.apk" + - name: Install iOS pods + if: matrix.platform == 'ios' + working-directory: ${{ env.CONSUMER_DIR }}/ios + run: pod install 2>&1 | tee "$LOG_DIR/pods.log" + - name: Archive iOS release without signing + if: matrix.platform == 'ios' + working-directory: ${{ env.CONSUMER_DIR }} + run: | + xcodebuild -workspace ios/ConsumerBuild.xcworkspace -scheme ConsumerBuild \ + -configuration Release -destination 'generic/platform=iOS' \ + -archivePath "$RUNNER_TEMP/ConsumerBuild.xcarchive" \ + -derivedDataPath "$RUNNER_TEMP/consumer-derived-data" \ + -resultBundlePath "$LOG_DIR/ios.xcresult" \ + CODE_SIGNING_ALLOWED=NO archive 2>&1 | tee "$LOG_DIR/ios.log" + app="$RUNNER_TEMP/ConsumerBuild.xcarchive/Products/Applications/ConsumerBuild.app" + test -f "$app/ConsumerBuild" + test -f "$app/main.jsbundle" + # Enforce the manifest's archive presence once #1627 lands, without + # duplicating that PR or hiding its current absence from the baseline. + if [[ -f node_modules/react-native-executorch/ios/PrivacyInfo.xcprivacy ]]; then + test -f "$app/RnExecutorchPrivacyInfo.bundle/PrivacyInfo.xcprivacy" + plutil -lint "$app/RnExecutorchPrivacyInfo.bundle/PrivacyInfo.xcprivacy" + fi + - name: Collect consumer configuration + if: always() + run: | + mkdir -p "$LOG_DIR" + for file in consumer-profile.json package.json package-lock.json android/gradle.properties android/build.gradle android/app/build.gradle ios/Podfile ios/Podfile.lock ios/Podfile.properties.json; do + if [[ -f "$CONSUMER_DIR/$file" ]]; then + destination="$LOG_DIR/config/$file" + mkdir -p "$(dirname "$destination")" + cp "$CONSUMER_DIR/$file" "$destination" + fi + done + if [[ -f "$CONSUMER_DIR/node_modules/react-native-executorch/rne-build-config.json" ]]; then + cp "$CONSUMER_DIR/node_modules/react-native-executorch/rne-build-config.json" "$LOG_DIR/" + fi + - uses: actions/upload-artifact@v4 + if: always() + with: + name: consumer-build-${{ matrix.profile }}-${{ matrix.platform }} + path: ${{ env.LOG_DIR }} + if-no-files-found: warn + retention-days: 7 From c767f515e735a5976d500c36bedcc85354344996 Mon Sep 17 00:00:00 2001 From: Bartosz Hanc Date: Thu, 12 Nov 2026 15:54:27 +0100 Subject: [PATCH 2/7] =?UTF-8?q?ci:=20cover=20Expo=20SDKs=2055=E2=80=9358?= =?UTF-8?q?=20and=20use=20the=20hosted=20Android=20SDK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/consumer-builds/README.md | 46 +++++++++++++--------- .github/consumer-builds/compatibility.json | 33 ++++++++++++++++ .github/consumer-builds/matrix.test.mjs | 10 +++-- .github/workflows/consumer-builds.yml | 8 +++- 4 files changed, 73 insertions(+), 24 deletions(-) diff --git a/.github/consumer-builds/README.md b/.github/consumer-builds/README.md index 0392de868c..fe14369ee7 100644 --- a/.github/consumer-builds/README.md +++ b/.github/consumer-builds/README.md @@ -1,6 +1,6 @@ # Consumer build matrix - + The [Consumer builds workflow](../workflows/consumer-builds.yml) installs one published-format library tarball into fresh consumer applications outside the @@ -11,43 +11,51 @@ cannot resolve the repository's workspace dependencies or library source files. [compatibility.json](./compatibility.json) declares supported RN minors for each pinned Worklets release, pinned RN patches and peer versions, and the Expo -fixture. [matrix.mjs](./matrix.mjs) generates every declared compatible pair and +fixtures. [matrix.mjs](./matrix.mjs) generates every declared compatible pair and expands it across Android and iOS. One workflow plans, packs and builds them. -| React Native | Compatible Worklets pins | Release app builds | -| ------------------------ | ---------------------------------------------------------- | ------------------ | -| 0.83.6 | 0.10.4, 0.11.4, 0.12.2 | 6 | -| 0.84.1 | 0.10.4, 0.11.4, 0.12.2 | 6 | -| 0.85.3 | 0.10.4, 0.11.4, 0.12.2 | 6 | -| 0.86.3 | 0.10.4, 0.11.4, 0.12.2, 0.13.0 | 8 | -| 0.87.1 | 0.12.2, 0.13.0 | 4 | -| 0.88.1 | 0.13.0 | 2 | -| Expo 57.0.28 / RN 0.86.3 | 0.13.0 | 2 | -| **Total** | **16 bare pairs + 1 Expo fixture, each on both platforms** | **34** | - -- **Relevant pull requests:** all 34 app builds per run, 17 Android and 17 iOS. +| React Native | Compatible Worklets pins | Release app builds | +| ------------------------- | ----------------------------------------------------------- | ------------------ | +| 0.83.6 | 0.10.4, 0.11.4, 0.12.2 | 6 | +| 0.84.1 | 0.10.4, 0.11.4, 0.12.2 | 6 | +| 0.85.3 | 0.10.4, 0.11.4, 0.12.2 | 6 | +| 0.86.3 | 0.10.4, 0.11.4, 0.12.2, 0.13.0 | 8 | +| 0.87.1 | 0.12.2, 0.13.0 | 4 | +| 0.88.1 | 0.13.0 | 2 | +| Expo 55.0.32 / RN 0.83.10 | 0.10.4 | 2 | +| Expo 56.0.24 / RN 0.85.3 | 0.10.4 | 2 | +| Expo 57.0.28 / RN 0.86.3 | 0.13.0 | 2 | +| Expo 58.0.24 / RN 0.88.1 | 0.13.0 | 2 | +| **Total** | **16 bare pairs + 4 Expo fixtures, each on both platforms** | **40** | + +- **Relevant pull requests:** all 40 app builds per run, 20 Android and 20 iOS. Path filters select library, harness, workflow and dependency changes targeting `main`. -- **Manual dispatch:** `full` runs 34 app builds; `pr` runs the four boundary +- **Manual dispatch:** `full` runs 40 app builds; `pr` runs the four boundary builds (RN 0.83.6 / Worklets 0.10.4 and RN 0.88.1 / Worklets 0.13.0, each on both platforms). - **No scheduled runs yet.** A TODO in the workflow tracks moving the full matrix to a nightly cron job and restoring boundary-only PR coverage after validation. Every full run also has one planning/test job and one shared library build/package -job: **36 jobs total**, with at most four app builds concurrently. The optional +job: **42 jobs total**, with at most four app builds concurrently. The optional manual boundary run has six jobs total. The compatibility rules match the pinned Worklets packages' published RN peer ranges. For example, Worklets 0.13 supports RN 0.86–0.88, whereas 0.12 supports 0.83–0.87. Every compatible combination of the declared pins is built on relevant PRs; this does not test every patch release or expand support to Worklets 0.14. +Expo RN/React/build-properties pins follow each SDK's `bundledNativeModules.json`. +SDKs 55 and 56 bundle Worklets below this library's minimum; these fixtures +explicitly install 0.10.4, as required by the integration documentation. SDKs 57 +and 58 use 0.13.0. These are native prebuild tests, not Expo Go or EAS tests. + blob-util is pinned to 0.25.1 for RN 0.83 and 1.0.0 for newer RN versions, because blob-util 1.0 requires RN >=0.84. -All builds are Release: Android uses Ubuntu 24.04, Java 17, arm64 and R8; iOS uses +All builds are Release: Android uses Ubuntu 24.04, Java 17, the hosted runner's preinstalled Android SDK, arm64 and R8; iOS uses an Apple Silicon macOS 26 runner and creates an unsigned device archive. Framework -linkage, backend subsets, Debug, RN nightly and other Expo SDKs are separate +linkage, backend subsets, Debug and RN nightly are separate coverage to add, not extra dimensions of this matrix. ## What it checks @@ -90,7 +98,7 @@ cd /tmp/ConsumerBuild/android Adjust the tarball filename to the package version. For iOS, pass `ios` instead of `android`, run `pod install` in the generated `ios/` directory, then use the -workflow's archive command. `expo-57` works on either platform. iOS app +workflow's archive command. `expo-55`, `expo-56`, `expo-57` and `expo-58` work on either platform. iOS app deployment targets are at least 17.0, preserving a higher RN requirement. Compatibility data pins the framework, Worklets, blob-util and CLI; other template and diff --git a/.github/consumer-builds/compatibility.json b/.github/consumer-builds/compatibility.json index 99a45bdf72..d2a12cf4f6 100644 --- a/.github/consumer-builds/compatibility.json +++ b/.github/consumer-builds/compatibility.json @@ -33,6 +33,28 @@ } ], "expo": [ + { + "id": "expo-55", + "expo": "55.0.32", + "reactNative": "0.83.10", + "react": "19.2.0", + "worklets": "0.10.4", + "blobUtil": "0.25.1", + "buildProperties": "55.0.18", + "babelPreset": "55.0.25", + "babelCore": "7.29.7" + }, + { + "id": "expo-56", + "expo": "56.0.24", + "reactNative": "0.85.3", + "react": "19.2.3", + "worklets": "0.10.4", + "blobUtil": "1.0.0", + "buildProperties": "56.0.27", + "babelPreset": "56.0.21", + "babelCore": "7.29.7" + }, { "id": "expo-57", "expo": "57.0.28", @@ -43,6 +65,17 @@ "buildProperties": "57.0.22", "babelPreset": "57.0.15", "babelCore": "7.29.7" + }, + { + "id": "expo-58", + "expo": "58.0.24", + "reactNative": "0.88.1", + "react": "19.3.0", + "worklets": "0.13.0", + "blobUtil": "1.0.0", + "buildProperties": "58.0.12", + "babelPreset": "58.0.25", + "babelCore": "7.29.7" } ], "worklets": [ diff --git a/.github/consumer-builds/matrix.test.mjs b/.github/consumer-builds/matrix.test.mjs index f178214c3c..f94daf646f 100644 --- a/.github/consumer-builds/matrix.test.mjs +++ b/.github/consumer-builds/matrix.test.mjs @@ -24,8 +24,12 @@ test('the full matrix builds every declared compatible pair on both platforms', const { matrix } = createMatrix('full'); const { bare, expo } = createProfiles(); assert.equal(bare.length, 16); - assert.equal(matrix.include.length, 34); - assert.equal(matrix.include.filter((cell) => cell.profile.startsWith('expo-')).length, 2); + assert.deepEqual( + expo.map((p) => p.id), + ['expo-55', 'expo-56', 'expo-57', 'expo-58'] + ); + assert.equal(matrix.include.length, 40); + assert.equal(matrix.include.filter((cell) => cell.profile.startsWith('expo-')).length, 8); const expected = { 0.83: ['0.10', '0.11', '0.12'], 0.84: ['0.10', '0.11', '0.12'], @@ -77,7 +81,7 @@ test('each artifact id is unique across bare and Expo cells', () => { test('profile lookup supplies its family and pinned CLI, and rejects typos', () => { assert.equal(findProfile('rn-0-83-worklets-0-10').family, 'bare'); - assert.equal(findProfile('expo-57').family, 'expo'); + for (const sdk of [55, 56, 57, 58]) assert.equal(findProfile(`expo-${sdk}`).family, 'expo'); assert.match(findProfile('rn-0-88-worklets-0-13').cli, /^\d+\.\d+\.\d+$/); assert.throws(() => findProfile('rn-0-89'), /Unknown consumer profile/); assert.throws(() => createMatrix('typo'), /Unknown matrix scope/); diff --git a/.github/workflows/consumer-builds.yml b/.github/workflows/consumer-builds.yml index 19cf4494fd..8edd29d1f1 100644 --- a/.github/workflows/consumer-builds.yml +++ b/.github/workflows/consumer-builds.yml @@ -127,13 +127,17 @@ jobs: pod --version fi } 2>&1 | tee "$LOG_DIR/toolchain.log" - - uses: actions/setup-java@v4 + - uses: actions/setup-java@v5 if: matrix.platform == 'android' with: distribution: temurin java-version: '17' - - uses: android-actions/setup-android@v3 + - name: Use the hosted runner's Android SDK if: matrix.platform == 'android' + run: | + test -n "$ANDROID_HOME" + test -x "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" + echo "$ANDROID_HOME/cmdline-tools/latest/bin" >> "$GITHUB_PATH" - name: Record Android toolchain if: matrix.platform == 'android' run: | From 89836fd8ee8b57253d7c3c5bf714c7ef7b08c3d9 Mon Sep 17 00:00:00 2001 From: Bartosz Hanc Date: Thu, 12 Nov 2026 16:04:01 +0100 Subject: [PATCH 3/7] ci: run Expo builds by default and keep bare compatibility manual --- .agents/skills/verify-and-build/SKILL.md | 3 +- .github/consumer-builds/README.md | 31 ++++++++++---------- .github/consumer-builds/matrix.mjs | 11 +++---- .github/consumer-builds/matrix.test.mjs | 37 ++++++++++++------------ .github/workflows/consumer-builds.yml | 10 +++---- 5 files changed, 46 insertions(+), 46 deletions(-) diff --git a/.agents/skills/verify-and-build/SKILL.md b/.agents/skills/verify-and-build/SKILL.md index 69eb1b54da..0587ccefe2 100644 --- a/.agents/skills/verify-and-build/SKILL.md +++ b/.agents/skills/verify-and-build/SKILL.md @@ -110,7 +110,8 @@ phoneme output. Use device/emulator integration for those behaviors. The [consumer build matrix](../../../.github/consumer-builds/README.md) checks a packed library in fresh bare RN and Expo applications on Android and iOS. It -runs the full compatibility matrix on relevant PRs and supports manual dispatch. +runs Expo profiles on relevant PRs; manual dispatch can also select the full +bare RN/Worklets matrix. Use it for publication, installation, autolinking, release bundling and native build regressions. It does not launch applications or establish device inference. The linked README owns its version pins, commands, diff --git a/.github/consumer-builds/README.md b/.github/consumer-builds/README.md index fe14369ee7..1f100ab08f 100644 --- a/.github/consumer-builds/README.md +++ b/.github/consumer-builds/README.md @@ -28,22 +28,23 @@ expands it across Android and iOS. One workflow plans, packs and builds them. | Expo 58.0.24 / RN 0.88.1 | 0.13.0 | 2 | | **Total** | **16 bare pairs + 4 Expo fixtures, each on both platforms** | **40** | -- **Relevant pull requests:** all 40 app builds per run, 20 Android and 20 iOS. - Path filters select library, harness, workflow and dependency changes targeting - `main`. -- **Manual dispatch:** `full` runs 40 app builds; `pr` runs the four boundary - builds (RN 0.83.6 / Worklets 0.10.4 and RN 0.88.1 / Worklets 0.13.0, each on both - platforms). -- **No scheduled runs yet.** A TODO in the workflow tracks moving the full matrix - to a nightly cron job and restoring boundary-only PR coverage after validation. - -Every full run also has one planning/test job and one shared library build/package -job: **42 jobs total**, with at most four app builds concurrently. The optional -manual boundary run has six jobs total. +- **Relevant pull requests:** eight Expo app builds per run, four Android and + four iOS. Bare RN builds do not run automatically. Path filters select library, + harness, workflow and dependency changes targeting `main`. +- **Manual dispatch:** `expo` (the default) runs eight Expo app builds; `full` + runs all 40 app builds, including every declared bare RN/Worklets pair. Use + `full` for releases, native changes and compatibility investigations. +- **No scheduled runs yet.** A TODO tracks considering daily Expo coverage after + validation; the broader bare RN matrix remains manual. + +Each run has one planning/test job and one shared library build/package job: +**10 jobs for regular Expo coverage, 42 for manual full coverage**, with at most +four app builds concurrently. The table above shows the complete manual matrix; +only its four Expo profiles are routinely tested on PRs. The compatibility rules match the pinned Worklets packages' published RN peer ranges. For example, Worklets 0.13 supports RN 0.86–0.88, whereas 0.12 supports -0.83–0.87. Every compatible combination of the declared pins is built on relevant PRs; +0.83–0.87. The manual `full` scope builds every compatible combination of the declared pins; this does not test every patch release or expand support to Worklets 0.14. Expo RN/React/build-properties pins follow each SDK's `bundledNativeModules.json`. SDKs 55 and 56 bundle Worklets below this library's minimum; these fixtures @@ -88,7 +89,7 @@ RNET_SKIP_DOWNLOAD=1 yarn install --immutable (cd packages/react-native-executorch && RNET_SKIP_DOWNLOAD=1 RNE_SKIP_INSTALL=1 GIT_LFS_SKIP_SMUDGE=1 ./scripts/create-package.sh) # Use a new directory outside the checkout. Leave RNET_SKIP_DOWNLOAD unset. -node .github/consumer-builds/prepare.mjs rn-0-83-worklets-0-10 android \ +node .github/consumer-builds/prepare.mjs expo-55 android \ packages/react-native-executorch/react-native-executorch-1.0.0.tgz \ /tmp/ConsumerBuild @@ -114,7 +115,7 @@ Update the JSON pins and compatibility declarations deliberately, checking the published npm peer requirements. Every configured RN minor must have a compatible Worklets version, every Worklets RN declaration must name a configured RN minor, and Expo must use a declared compatible pair. The tests verify full combination -coverage, unique artifact ids, and manual boundary selection. The planning job reports +coverage, unique artifact ids, and Expo-only default selection. The planning job reports the actual build count in the GitHub job summary; update the table and expected counts in the tests when changing support. diff --git a/.github/consumer-builds/matrix.mjs b/.github/consumer-builds/matrix.mjs index f486daf725..13e8424c32 100644 --- a/.github/consumer-builds/matrix.mjs +++ b/.github/consumer-builds/matrix.mjs @@ -101,13 +101,10 @@ export function findProfile(id) { return profile; } -export function createMatrix(scope, config = readCompatibility()) { - if (!['pr', 'full'].includes(scope)) throw new Error(`Unknown matrix scope: ${scope}`); +export function createMatrix(scope = 'expo', config = readCompatibility()) { + if (!['expo', 'full'].includes(scope)) throw new Error(`Unknown matrix scope: ${scope}`); const { bare, expo } = createProfiles(config); - // Sorting in createProfiles makes these the oldest and newest declared valid - // RN/Worklets pairs, independent of the order in the JSON file. - const boundaries = [...new Set([bare[0], bare.at(-1)])]; - const profiles = scope === 'full' ? [...bare, ...expo] : boundaries; + const profiles = scope === 'full' ? [...bare, ...expo] : expo; return { scope, matrix: { @@ -123,7 +120,7 @@ export function createMatrix(scope, config = readCompatibility()) { } if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) { - const result = createMatrix(process.argv[2] ?? 'full'); + const result = createMatrix(process.argv[2] ?? 'expo'); console.log(JSON.stringify(result, null, 2)); if (process.env.GITHUB_OUTPUT) { for (const [key, value] of Object.entries(result)) { diff --git a/.github/consumer-builds/matrix.test.mjs b/.github/consumer-builds/matrix.test.mjs index f94daf646f..95f6c1243b 100644 --- a/.github/consumer-builds/matrix.test.mjs +++ b/.github/consumer-builds/matrix.test.mjs @@ -7,15 +7,20 @@ import { test } from 'node:test'; import { fileURLToPath } from 'node:url'; import { createMatrix, createProfiles, findProfile, readCompatibility } from './matrix.mjs'; -test('boundary scope builds the oldest and newest RN profiles on both platforms', () => { - const { matrix } = createMatrix('pr'); +test('the default matrix contains only Expo SDKs 55–58 on both platforms', () => { + const { scope, matrix } = createMatrix(); + assert.equal(scope, 'expo'); assert.deepEqual( matrix.include.map((cell) => cell.id), [ - 'rn-0-83-worklets-0-10-android', - 'rn-0-83-worklets-0-10-ios', - 'rn-0-88-worklets-0-13-android', - 'rn-0-88-worklets-0-13-ios', + 'expo-55-android', + 'expo-55-ios', + 'expo-56-android', + 'expo-56-ios', + 'expo-57-android', + 'expo-57-ios', + 'expo-58-android', + 'expo-58-ios', ] ); }); @@ -53,11 +58,11 @@ test('the full matrix builds every declared compatible pair on both platforms', } }); -test('boundary selection does not depend on JSON entry ordering', () => { +test('bare expansion does not depend on JSON entry ordering', () => { const config = readCompatibility(); config.bare.reverse(); config.worklets.reverse(); - assert.deepEqual(createMatrix('pr', config), createMatrix('pr')); + assert.deepEqual(createProfiles(config).bare, createProfiles().bare); }); test('invalid declarations fail instead of silently dropping compatibility coverage', () => { @@ -92,13 +97,9 @@ test('the CLI writes single-line JSON matrices usable by GitHub job outputs', () const output = join(directory, 'outputs'); const summary = join(directory, 'summary'); try { - execFileSync( - process.execPath, - [fileURLToPath(new URL('./matrix.mjs', import.meta.url)), 'pr'], - { - env: { ...process.env, GITHUB_OUTPUT: output, GITHUB_STEP_SUMMARY: summary }, - } - ); + execFileSync(process.execPath, [fileURLToPath(new URL('./matrix.mjs', import.meta.url))], { + env: { ...process.env, GITHUB_OUTPUT: output, GITHUB_STEP_SUMMARY: summary }, + }); const outputs = Object.fromEntries( readFileSync(output, 'utf8') .trim() @@ -108,9 +109,9 @@ test('the CLI writes single-line JSON matrices usable by GitHub job outputs', () return [line.slice(0, separator), line.slice(separator + 1)]; }) ); - assert.equal(outputs.scope, 'pr'); - assert.equal(JSON.parse(outputs.matrix).include.length, 4); - assert.match(readFileSync(summary, 'utf8'), /4 Release app builds: 2 Android and 2 iOS/); + assert.equal(outputs.scope, 'expo'); + assert.equal(JSON.parse(outputs.matrix).include.length, 8); + assert.match(readFileSync(summary, 'utf8'), /8 Release app builds: 4 Android and 4 iOS/); } finally { rmSync(directory, { recursive: true, force: true }); } diff --git a/.github/workflows/consumer-builds.yml b/.github/workflows/consumer-builds.yml index 8edd29d1f1..7d35c367b4 100644 --- a/.github/workflows/consumer-builds.yml +++ b/.github/workflows/consumer-builds.yml @@ -16,10 +16,10 @@ on: scope: description: Version coverage type: choice - options: [full, pr] - default: full - # TODO: After validating the full matrix on PRs, move it to a nightly cron - # job and restore the four boundary builds for pull_request events. + options: [expo, full] + default: expo + # TODO: After validating Expo PR builds, consider moving regular Expo coverage + # to a daily cron job. Keep the full bare RN matrix available manually. # schedule: # - cron: '17 4 * * *' @@ -49,7 +49,7 @@ jobs: - name: Generate version matrices id: matrix env: - MATRIX_SCOPE: ${{ inputs.scope || 'full' }} + MATRIX_SCOPE: ${{ inputs.scope || 'expo' }} run: node .github/consumer-builds/matrix.mjs "$MATRIX_SCOPE" package: From 5442ef76932575e3fcc6a58708a294384b119e37 Mon Sep 17 00:00:00 2001 From: Bartosz Hanc Date: Thu, 12 Nov 2026 16:39:01 +0100 Subject: [PATCH 4/7] ci: add Windows builds and native consumer smoke tests --- .agents/skills/verify-and-build/SKILL.md | 7 +- .github/consumer-builds/README.md | 108 ++++++++----- .github/consumer-builds/compatibility.json | 3 +- .github/consumer-builds/host.mjs | 30 ++++ .github/consumer-builds/host.test.mjs | 38 +++++ .github/consumer-builds/matrix.mjs | 40 +++-- .github/consumer-builds/matrix.test.mjs | 40 ++++- .github/consumer-builds/prepare.mjs | 45 ++++-- .github/consumer-builds/smoke-fixture.mjs | 44 +++++ .github/consumer-builds/smoke-runner.mjs | 150 ++++++++++++++++++ .github/consumer-builds/smoke-runner.test.mjs | 63 ++++++++ .github/workflows/consumer-builds.yml | 91 +++++++++-- .../consumer-fixtures}/App.jsx | 0 apps/consumer-fixtures/App.smoke.jsx | 102 ++++++++++++ 14 files changed, 683 insertions(+), 78 deletions(-) create mode 100644 .github/consumer-builds/host.mjs create mode 100644 .github/consumer-builds/host.test.mjs create mode 100644 .github/consumer-builds/smoke-fixture.mjs create mode 100644 .github/consumer-builds/smoke-runner.mjs create mode 100644 .github/consumer-builds/smoke-runner.test.mjs rename {.github/consumer-builds => apps/consumer-fixtures}/App.jsx (100%) create mode 100644 apps/consumer-fixtures/App.smoke.jsx diff --git a/.agents/skills/verify-and-build/SKILL.md b/.agents/skills/verify-and-build/SKILL.md index 0587ccefe2..e49e225242 100644 --- a/.agents/skills/verify-and-build/SKILL.md +++ b/.agents/skills/verify-and-build/SKILL.md @@ -110,11 +110,12 @@ phoneme output. Use device/emulator integration for those behaviors. The [consumer build matrix](../../../.github/consumer-builds/README.md) checks a packed library in fresh bare RN and Expo applications on Android and iOS. It -runs Expo profiles on relevant PRs; manual dispatch can also select the full +runs Expo profiles on relevant PRs, including Windows-hosted Android and two +emulator/simulator runtime smoke cells. Manual dispatch can also select the full bare RN/Worklets matrix. Use it for publication, installation, autolinking, release bundling and -native build regressions. It does not launch applications or -establish device inference. The linked README owns its version pins, commands, +native build regressions. Only the smoke cells launch apps and verify a bundled +XNNPACK model; other backends and physical devices still need separate verification. The linked README owns its version pins, commands, artifacts and limitations. Choose the relevant app (`computer-vision`, `nlp` or `speech`) and inspect its current native setup. diff --git a/.github/consumer-builds/README.md b/.github/consumer-builds/README.md index 1f100ab08f..3520d8718c 100644 --- a/.github/consumer-builds/README.md +++ b/.github/consumer-builds/README.md @@ -1,6 +1,6 @@ # Consumer build matrix - + The [Consumer builds workflow](../workflows/consumer-builds.yml) installs one published-format library tarball into fresh consumer applications outside the @@ -14,33 +14,34 @@ pinned Worklets release, pinned RN patches and peer versions, and the Expo fixtures. [matrix.mjs](./matrix.mjs) generates every declared compatible pair and expands it across Android and iOS. One workflow plans, packs and builds them. -| React Native | Compatible Worklets pins | Release app builds | -| ------------------------- | ----------------------------------------------------------- | ------------------ | -| 0.83.6 | 0.10.4, 0.11.4, 0.12.2 | 6 | -| 0.84.1 | 0.10.4, 0.11.4, 0.12.2 | 6 | -| 0.85.3 | 0.10.4, 0.11.4, 0.12.2 | 6 | -| 0.86.3 | 0.10.4, 0.11.4, 0.12.2, 0.13.0 | 8 | -| 0.87.1 | 0.12.2, 0.13.0 | 4 | -| 0.88.1 | 0.13.0 | 2 | -| Expo 55.0.32 / RN 0.83.10 | 0.10.4 | 2 | -| Expo 56.0.24 / RN 0.85.3 | 0.10.4 | 2 | -| Expo 57.0.28 / RN 0.86.3 | 0.13.0 | 2 | -| Expo 58.0.24 / RN 0.88.1 | 0.13.0 | 2 | -| **Total** | **16 bare pairs + 4 Expo fixtures, each on both platforms** | **40** | - -- **Relevant pull requests:** eight Expo app builds per run, four Android and - four iOS. Bare RN builds do not run automatically. Path filters select library, - harness, workflow and dependency changes targeting `main`. -- **Manual dispatch:** `expo` (the default) runs eight Expo app builds; `full` - runs all 40 app builds, including every declared bare RN/Worklets pair. Use - `full` for releases, native changes and compatibility investigations. +| React Native | Compatible Worklets pins | Release app builds | +| ---------------------------- | -------------------------------------------- | ------------------ | +| 0.83.6 | 0.10.4, 0.11.4, 0.12.2 | 6 | +| 0.84.1 | 0.10.4, 0.11.4, 0.12.2 | 6 | +| 0.85.3 | 0.10.4, 0.11.4, 0.12.2 | 6 | +| 0.86.3 | 0.10.4, 0.11.4, 0.12.2, 0.13.0 | 8 | +| 0.87.1 | 0.12.2, 0.13.0 | 4 | +| 0.88.1 | 0.13.0 | 2 | +| Expo 55.0.32 / RN 0.83.10 | 0.10.4 | 2 | +| Expo 56.0.24 / RN 0.85.3 | 0.10.4 | 2 | +| Expo 57.0.28 / RN 0.86.3 | 0.13.0 | 2 | +| Expo 58.0.24 / RN 0.88.1 | 0.13.0 | 2 | +| Latest Expo, Windows Android | Same versions as the latest SDK | 1 | +| Latest Expo, runtime smoke | Same versions as the latest SDK | 2 | +| **Total** | **32 bare + 8 Expo + 1 Windows + 2 runtime** | **43** | + +- **Relevant pull requests:** eleven app builds: eight SDK/platform builds, + one additional Expo 58 Android build on Windows, and two latest-Expo runtime + smoke apps (Android emulator on Linux, iOS simulator on macOS). +- **Manual dispatch:** `expo` (the default) runs those eleven builds; `full` + adds all 32 bare RN/Worklets builds for **43 app builds**. Use `full` for + releases, native changes and compatibility investigations. - **No scheduled runs yet.** A TODO tracks considering daily Expo coverage after validation; the broader bare RN matrix remains manual. -Each run has one planning/test job and one shared library build/package job: -**10 jobs for regular Expo coverage, 42 for manual full coverage**, with at most -four app builds concurrently. The table above shows the complete manual matrix; -only its four Expo profiles are routinely tested on PRs. +Each run also has one planning/test job and one shared library build/package job: +**13 jobs for regular coverage, 45 for manual full coverage**, with at most four +app builds concurrently. The table above shows the complete manual matrix. The compatibility rules match the pinned Worklets packages' published RN peer ranges. For example, Worklets 0.13 supports RN 0.86–0.88, whereas 0.12 supports @@ -54,10 +55,20 @@ and 58 use 0.13.0. These are native prebuild tests, not Expo Go or EAS tests. blob-util is pinned to 0.25.1 for RN 0.83 and 1.0.0 for newer RN versions, because blob-util 1.0 requires RN >=0.84. -All builds are Release: Android uses Ubuntu 24.04, Java 17, the hosted runner's preinstalled Android SDK, arm64 and R8; iOS uses -an Apple Silicon macOS 26 runner and creates an unsigned device archive. Framework -linkage, backend subsets, Debug and RN nightly are separate -coverage to add, not extra dimensions of this matrix. +All builds are Release. Android uses Java 17, the hosted runner's preinstalled +SDK, and R8. Regular Linux/Windows Android builds target arm64; the Linux runtime +app targets x86_64 for the emulator. Windows uses `windows-2025` and a short +`C:\rnet\app` consumer path, with direct npm JavaScript entry points instead of +spawning `.cmd` scripts. iOS builds run on Apple Silicon macOS 26: regular cells +archive for devices, while the runtime cell builds for a simulator. + +App source lives in [apps/consumer-fixtures](../../apps/consumer-fixtures/), which +intentionally has no package manifest and is not a workspace. CI helpers stay in +`.github/consumer-builds/`. Preparation copies the app source into an isolated +consumer outside the repository. + +Framework linkage variants, backend subsets, Debug, RN nightly, EAS and OTA +remain separate coverage to add. ## What it checks @@ -66,7 +77,8 @@ coverage to add, not extra dimensions of this matrix. - npm installs the tarball and executes the real native-library postinstall hook. - Bare RN and Expo autolinking, Worklets Babel configuration, native compilation, release JS bundling, and Android R8 complete successfully. -- APKs contain arm64 RNE, ExecuTorch, XNNPACK and Vulkan shared libraries. +- APKs contain RNE, ExecuTorch, XNNPACK and Vulkan shared libraries for the + selected ABI. - iOS archives contain the application executable and JS bundle. When the package ships its privacy manifest, the resource bundle must appear in the archive and pass `plutil` validation. @@ -75,8 +87,30 @@ All optional native libraries for the selected platform are enabled. Postinstall fetches only that platform via `RNET_TARGET`. This does not test cross-host Expo fingerprint equality or backend opt-outs. -The workflow does not launch apps, run models, validate App Store uploads or test -EAS/OTA. A passing build does not establish successful device inference. +## Runtime smoke checks + +Only the two latest-Expo smoke cells launch an app. They assert: + +1. Native tensor allocation, data transfer and softmax produce expected values. +2. A sliced typed array survives a worklet round trip and native tensor use. +3. A bundled selfie-segmentation model loads with `XnnpackBackend` and executes + on the worklet runtime, replacing NaN sentinel outputs with finite probabilities. + +The approximately 486 KB model is downloaded during preparation at the exact +revision and SHA-256 used by the host-test fixture script. It is bundled as a +`.pte` asset and resolved to a local file by `expo-asset`. No model binary is +committed, and the app does not fetch a model from the network at runtime. + +A loopback HTTP collector waits for a report containing all three assertions and +a per-build random token. App crashes, missing reports, assertion failures and +incomplete reports fail CI. The reporter's own tests verify those failure paths. +Android reaches the collector through `adb reverse`; iOS uses simulator loopback. +Cleartext loopback access is enabled only in the smoke fixtures. Native/runtime +logs and the successful report are retained in the cell's artifact. + +This verifies XNNPACK inference on emulators/simulators. It does not establish +Core ML, Vulkan or MLX inference, real camera/audio behavior, App Store validation, +EAS or OTA compatibility. Version build cells remain build-only checks. ## Run locally @@ -114,17 +148,19 @@ cache skips compilation of a new library commit. Update the JSON pins and compatibility declarations deliberately, checking the published npm peer requirements. Every configured RN minor must have a compatible Worklets version, every Worklets RN declaration must name a configured RN minor, -and Expo must use a declared compatible pair. The tests verify full combination -coverage, unique artifact ids, and Expo-only default selection. The planning job reports +and Expo must use a declared compatible pair. The newest Expo profile also pins +`expoAsset` for the bundled-model smoke app. Windows and runtime cells follow +that newest profile automatically. The tests verify full combination +coverage, unique artifact ids, default host/runtime selection and smoke report failures. The planning job reports the actual build count in the GitHub job summary; update the table and expected counts in the tests when changing support. ```bash -node --test .github/consumer-builds/matrix.test.mjs +node --test .github/consumer-builds/*.test.mjs node .github/consumer-builds/matrix.mjs full node --check .github/consumer-builds/prepare.mjs actionlint .github/workflows/consumer-builds.yml -yarn prettier --ignore-path /dev/null --check '.github/consumer-builds/*' '.github/workflows/consumer-build*.yml' +yarn prettier --ignore-path /dev/null --check '.github/consumer-builds/*' '.github/workflows/consumer-build*.yml' 'apps/consumer-fixtures/*.jsx' ``` Exercise preparation and the affected platform build after changing templates or diff --git a/.github/consumer-builds/compatibility.json b/.github/consumer-builds/compatibility.json index d2a12cf4f6..d6ba9e0879 100644 --- a/.github/consumer-builds/compatibility.json +++ b/.github/consumer-builds/compatibility.json @@ -75,7 +75,8 @@ "blobUtil": "1.0.0", "buildProperties": "58.0.12", "babelPreset": "58.0.25", - "babelCore": "7.29.7" + "babelCore": "7.29.7", + "expoAsset": "58.0.21" } ], "worklets": [ diff --git a/.github/consumer-builds/host.mjs b/.github/consumer-builds/host.mjs new file mode 100644 index 0000000000..f02c161fe9 --- /dev/null +++ b/.github/consumer-builds/host.mjs @@ -0,0 +1,30 @@ +import path from 'node:path'; + +export function isInside(parent, child, paths = path) { + const relative = paths.relative(parent, child); + return ( + relative === '' || + (!paths.isAbsolute(relative) && relative !== '..' && !relative.startsWith(`..${paths.sep}`)) + ); +} + +export function packageManagerCommand( + command, + args, + platform = process.platform, + execPath = process.execPath +) { + if (!['npm', 'npx'].includes(command)) + throw new Error(`Unsupported package manager command: ${command}`); + if (platform !== 'win32') return { command, args }; + // Windows npm/npx entry points are .cmd scripts. Invoke the npm installation + // shipped beside node.exe directly, keeping paths and arguments out of a shell. + const cli = path.win32.join( + path.win32.dirname(execPath), + 'node_modules', + 'npm', + 'bin', + `${command}-cli.js` + ); + return { command: execPath, args: [cli, ...args] }; +} diff --git a/.github/consumer-builds/host.test.mjs b/.github/consumer-builds/host.test.mjs new file mode 100644 index 0000000000..e6f89a244c --- /dev/null +++ b/.github/consumer-builds/host.test.mjs @@ -0,0 +1,38 @@ +import assert from 'node:assert/strict'; +import { spawnSync } from 'node:child_process'; +import { posix, win32 } from 'node:path'; +import { test } from 'node:test'; +import { isInside, packageManagerCommand } from './host.mjs'; + +test('consumer isolation handles Windows separators, drive letters and sibling prefixes', () => { + assert.equal(isInside('C:\\repo', 'C:\\repo\\consumer', win32), true); + assert.equal(isInside('C:\\repo', 'c:\\REPO', win32), true); + assert.equal(isInside('C:\\repo', 'C:\\repo-copy\\consumer', win32), false); + assert.equal(isInside('C:\\repo', 'C:\\', win32), false); + assert.equal(isInside('C:\\repo', 'D:\\consumer', win32), false); + assert.equal(isInside('/repo', '/repo/consumer', posix), true); + assert.equal(isInside('/repo', '/repo-copy/consumer', posix), false); + assert.equal(isInside('/repo', '/', posix), false); +}); + +test('Windows npm and npx use node with distinct arguments, including paths with spaces', () => { + const node = 'C:\\Program Files\\nodejs\\node.exe'; + const args = ['install', 'file:C:\\app & fixtures\\library.tgz']; + assert.deepEqual(packageManagerCommand('npm', args, 'win32', node), { + command: node, + args: ['C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', ...args], + }); + assert.deepEqual(packageManagerCommand('npx', ['--no-install', 'expo'], 'win32', node).args, [ + 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npx-cli.js', + '--no-install', + 'expo', + ]); + assert.deepEqual(packageManagerCommand('npm', args, 'linux'), { command: 'npm', args }); +}); + +test('the real host can invoke the selected npm entry point', () => { + const command = packageManagerCommand('npm', ['--version']); + const result = spawnSync(command.command, command.args, { encoding: 'utf8' }); + assert.equal(result.status, 0, result.error?.message ?? result.stderr); + assert.match(result.stdout.trim(), /^\d+\.\d+\.\d+$/); +}); diff --git a/.github/consumer-builds/matrix.mjs b/.github/consumer-builds/matrix.mjs index 13e8424c32..15a432ca26 100644 --- a/.github/consumer-builds/matrix.mjs +++ b/.github/consumer-builds/matrix.mjs @@ -91,30 +91,46 @@ export function createProfiles(config = readCompatibility()) { } return { ...profile, family: 'expo', cli: config.cli }; }); - return { bare, expo }; + const latestExpo = [...expo].sort((a, b) => compareVersions(a.expo, b.expo)).at(-1); + requireVersion(latestExpo.expoAsset, `${latestExpo.id}.expoAsset`); + const smoke = { ...latestExpo, id: `${latestExpo.id}-smoke`, smoke: true }; + requireId(smoke.id); + return { bare, expo, smoke }; } export function findProfile(id) { - const { bare, expo } = createProfiles(); - const profile = [...bare, ...expo].find((profile) => profile.id === id); + const { bare, expo, smoke } = createProfiles(); + const profile = [...bare, ...expo, smoke].find((profile) => profile.id === id); if (!profile) throw new Error(`Unknown consumer profile: ${id}`); return profile; } export function createMatrix(scope = 'expo', config = readCompatibility()) { if (!['expo', 'full'].includes(scope)) throw new Error(`Unknown matrix scope: ${scope}`); - const { bare, expo } = createProfiles(config); - const profiles = scope === 'full' ? [...bare, ...expo] : expo; + const { bare, expo, smoke } = createProfiles(config); + const profiles = scope === 'full' ? [...bare, ...expo, smoke] : [...expo, smoke]; + const latestExpo = [...expo].sort((a, b) => compareVersions(a.expo, b.expo)).at(-1); return { scope, matrix: { - include: profiles.flatMap((profile) => - ['android', 'ios'].map((platform) => ({ - profile: profile.id, - platform, - id: `${profile.id}-${platform}`, - })) - ), + include: [ + ...profiles.flatMap((profile) => + ['android', 'ios'].map((platform) => ({ + profile: profile.id, + platform, + id: `${profile.id}-${platform}`, + runner: platform === 'ios' ? 'macos-26' : 'ubuntu-24.04', + smoke: Boolean(profile.smoke), + })) + ), + { + profile: latestExpo.id, + platform: 'android', + id: `${latestExpo.id}-android-windows`, + runner: 'windows-2025', + smoke: false, + }, + ], }, }; } diff --git a/.github/consumer-builds/matrix.test.mjs b/.github/consumer-builds/matrix.test.mjs index 95f6c1243b..61cb9c922f 100644 --- a/.github/consumer-builds/matrix.test.mjs +++ b/.github/consumer-builds/matrix.test.mjs @@ -7,7 +7,7 @@ import { test } from 'node:test'; import { fileURLToPath } from 'node:url'; import { createMatrix, createProfiles, findProfile, readCompatibility } from './matrix.mjs'; -test('the default matrix contains only Expo SDKs 55–58 on both platforms', () => { +test('default coverage includes Expo SDKs, one Windows build and two runtime smoke apps', () => { const { scope, matrix } = createMatrix(); assert.equal(scope, 'expo'); assert.deepEqual( @@ -21,6 +21,9 @@ test('the default matrix contains only Expo SDKs 55–58 on both platforms', () 'expo-57-ios', 'expo-58-android', 'expo-58-ios', + 'expo-58-smoke-android', + 'expo-58-smoke-ios', + 'expo-58-android-windows', ] ); }); @@ -33,8 +36,8 @@ test('the full matrix builds every declared compatible pair on both platforms', expo.map((p) => p.id), ['expo-55', 'expo-56', 'expo-57', 'expo-58'] ); - assert.equal(matrix.include.length, 40); - assert.equal(matrix.include.filter((cell) => cell.profile.startsWith('expo-')).length, 8); + assert.equal(matrix.include.length, 43); + assert.equal(matrix.include.filter((cell) => cell.profile.startsWith('expo-')).length, 11); const expected = { 0.83: ['0.10', '0.11', '0.12'], 0.84: ['0.10', '0.11', '0.12'], @@ -52,7 +55,9 @@ test('the full matrix builds every declared compatible pair on both platforms', } for (const profile of [...bare, ...expo]) { assert.deepEqual( - matrix.include.filter((cell) => cell.profile === profile.id).map((cell) => cell.platform), + matrix.include + .filter((cell) => cell.profile === profile.id && cell.runner !== 'windows-2025') + .map((cell) => cell.platform), ['android', 'ios'] ); } @@ -110,9 +115,32 @@ test('the CLI writes single-line JSON matrices usable by GitHub job outputs', () }) ); assert.equal(outputs.scope, 'expo'); - assert.equal(JSON.parse(outputs.matrix).include.length, 8); - assert.match(readFileSync(summary, 'utf8'), /8 Release app builds: 4 Android and 4 iOS/); + assert.equal(JSON.parse(outputs.matrix).include.length, 11); + assert.match(readFileSync(summary, 'utf8'), /11 Release app builds: 6 Android and 5 iOS/); } finally { rmSync(directory, { recursive: true, force: true }); } }); + +test('Windows coverage stays on the newest Expo SDK regardless of configuration order', () => { + const config = readCompatibility(); + config.expo.reverse(); + const windows = createMatrix('full', config).matrix.include.filter( + (cell) => cell.runner === 'windows-2025' + ); + assert.deepEqual(windows, [ + { + profile: 'expo-58', + platform: 'android', + id: 'expo-58-android-windows', + runner: 'windows-2025', + smoke: false, + }, + ]); + const smoke = createMatrix().matrix.include.filter((cell) => cell.smoke); + assert.deepEqual( + smoke.map((cell) => cell.platform), + ['android', 'ios'] + ); + assert.ok(smoke.every((cell) => cell.profile === 'expo-58-smoke')); +}); diff --git a/.github/consumer-builds/prepare.mjs b/.github/consumer-builds/prepare.mjs index 0a464cef08..3eef2c5927 100644 --- a/.github/consumer-builds/prepare.mjs +++ b/.github/consumer-builds/prepare.mjs @@ -2,18 +2,22 @@ import { spawnSync } from 'node:child_process'; import { copyFileSync, existsSync, + lstatSync, mkdirSync, readFileSync, realpathSync, statSync, writeFileSync, } from 'node:fs'; -import { basename, dirname, isAbsolute, join, relative, resolve } from 'node:path'; +import { basename, dirname, join, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; import { findProfile } from './matrix.mjs'; +import { isInside, packageManagerCommand } from './host.mjs'; +import { prepareSmokeFixture } from './smoke-fixture.mjs'; const fixtures = dirname(fileURLToPath(import.meta.url)); const repository = resolve(fixtures, '../..'); +const appFixtures = join(repository, 'apps/consumer-fixtures'); const [profileId, platform, archiveArgument, directoryArgument] = process.argv.slice(2); if ( !['android', 'ios'].includes(platform) || @@ -26,6 +30,10 @@ if ( ); } const profile = findProfile(profileId); +const abi = profile.smoke && platform === 'android' ? 'x86_64' : 'arm64-v8a'; +const bundleIdentifier = profile.smoke + ? 'com.swmansion.executorch.consumersmoke' + : 'com.swmansion.executorch.consumerbuild'; const archive = realpathSync(archiveArgument); const requestedDirectory = resolve(directoryArgument); if (!statSync(archive).isFile() || !archive.endsWith('.tgz')) { @@ -34,8 +42,7 @@ if (!statSync(archive).isFile() || !archive.endsWith('.tgz')) { // npm must not discover the repository's workspaces or hoisted dependencies. mkdirSync(dirname(requestedDirectory), { recursive: true }); const directory = join(realpathSync(dirname(requestedDirectory)), basename(requestedDirectory)); -const fromRepository = relative(repository, directory); -if (fromRepository === '' || (!fromRepository.startsWith('../') && !isAbsolute(fromRepository))) { +if (isInside(repository, directory)) { throw new Error('Create the consumer outside the repository to avoid workspace resolution'); } if (existsSync(directory)) throw new Error(`Refusing to overwrite ${directory}`); @@ -44,7 +51,12 @@ if (process.env.RNET_SKIP_DOWNLOAD) function run(command, args, cwd) { console.log(`Running ${command} ${args.join(' ')} in ${cwd}`); - const result = spawnSync(command, args, { cwd, stdio: 'inherit', env: process.env }); + const selected = packageManagerCommand(command, args); + const result = spawnSync(selected.command, selected.args, { + cwd, + stdio: 'inherit', + env: process.env, + }); if (result.error) throw result.error; if (result.status !== 0) throw new Error(`${command} failed (${result.status ?? result.signal})`); } @@ -98,7 +110,7 @@ AppRegistry.registerComponent('ConsumerBuild', () => App); ` ); // Replace the template's App.tsx so Metro bundles this fixture. - copyFileSync(join(fixtures, 'App.jsx'), join(directory, 'App.tsx')); + copyFileSync(join(appFixtures, 'App.jsx'), join(directory, 'App.tsx')); replaceInFile( join(directory, 'ios/Podfile'), /^platform :ios, min_ios_version_supported$/m, @@ -135,6 +147,7 @@ AppRegistry.registerComponent('ConsumerBuild', () => App); 'expo-build-properties': profile.buildProperties, 'react-native-worklets': profile.worklets, 'react-native-blob-util': profile.blobUtil, + ...(profile.smoke ? { 'expo-asset': profile.expoAsset } : {}), }, devDependencies: { '@babel/core': profile.babelCore, 'babel-preset-expo': profile.babelPreset }, }; @@ -146,8 +159,13 @@ AppRegistry.registerComponent('ConsumerBuild', () => App); name: 'ConsumerBuild', slug: 'consumer-build', version: '1.0.0', - ios: { bundleIdentifier: 'com.swmansion.executorch.consumerbuild' }, - android: { package: 'com.swmansion.executorch.consumerbuild' }, + ios: { + bundleIdentifier, + ...(profile.smoke + ? { infoPlist: { NSAppTransportSecurity: { NSAllowsArbitraryLoads: true } } } + : {}), + }, + android: { package: bundleIdentifier }, plugins: [ [ 'expo-build-properties', @@ -155,8 +173,9 @@ AppRegistry.registerComponent('ConsumerBuild', () => App); ios: { deploymentTarget: '17.0' }, android: { minSdkVersion: 26, - buildArchs: ['arm64-v8a'], + buildArchs: [abi], enableMinifyInReleaseBuilds: true, + ...(profile.smoke ? { usesCleartextTraffic: true } : {}), }, }, ], @@ -174,7 +193,8 @@ import App from './App'; registerRootComponent(App); ` ); - copyFileSync(join(fixtures, 'App.jsx'), join(directory, 'App.jsx')); + copyFileSync(join(appFixtures, 'App.jsx'), join(directory, 'App.jsx')); + if (profile.smoke) await prepareSmokeFixture(directory); } copyFileSync(archive, join(directory, 'react-native-executorch.tgz')); manifest.dependencies['react-native-executorch'] = 'file:./react-native-executorch.tgz'; @@ -186,10 +206,13 @@ writeFileSync( join(directory, 'consumer-profile.json'), JSON.stringify({ ...profile, platform }, null, 2) + '\n' ); -process.env.RNET_TARGET = platform === 'android' ? 'android-arm64-v8a' : 'ios'; +// Emulator installs need the default downloads: the ABI-independent +// executorch.jar is distributed in the arm64 core archive. +if (platform === 'android' && profile.smoke) delete process.env.RNET_TARGET; +else process.env.RNET_TARGET = platform === 'android' ? `android-${abi}` : 'ios'; run('npm', ['install', '--foreground-scripts', '--no-audit', '--no-fund'], directory); const installed = join(directory, 'node_modules/react-native-executorch'); -if (realpathSync(installed) !== installed) +if (lstatSync(installed).isSymbolicLink() || !isInside(directory, realpathSync(installed))) throw new Error('Consumer installed a linked workspace instead of the tarball'); for (const file of [ 'lib/module/index.js', diff --git a/.github/consumer-builds/smoke-fixture.mjs b/.github/consumer-builds/smoke-fixture.mjs new file mode 100644 index 0000000000..8800fcca89 --- /dev/null +++ b/.github/consumer-builds/smoke-fixture.mjs @@ -0,0 +1,44 @@ +import { createHash, randomUUID } from 'node:crypto'; +import { copyFileSync, writeFileSync } from 'node:fs'; +import { dirname, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +// Same revision and checksum as scripts/fetch-test-fixtures.sh. Never commit +// model binaries or resolve a mutable Hugging Face branch in the smoke build. +export const modelUrl = + 'https://huggingface.co/software-mansion/MediaPipe-Selfie-Segmentation-ExecuTorch/resolve/13a9494d8230279b47973b91c94b1aa902d307a6/xnnpack/selfie_segmentation_xnnpack_fp32.pte'; +export const modelChecksum = '176aba6a0719b56391586a3d19396315305c7adb5c16aafda350fecc596cebf9'; + +export async function prepareSmokeFixture(directory) { + const response = await fetch(modelUrl, { signal: AbortSignal.timeout(120000) }); + if (!response.ok) throw new Error(`Model fixture download failed: ${response.status}`); + const bytes = Buffer.from(await response.arrayBuffer()); + if (createHash('sha256').update(bytes).digest('hex') !== modelChecksum) { + throw new Error('Model fixture checksum mismatch'); + } + writeFileSync(join(directory, 'smoke-model.pte'), bytes); + writeFileSync( + join(directory, 'smoke-config.json'), + JSON.stringify( + { + token: randomUUID(), + port: 18765, + bundleIdentifier: 'com.swmansion.executorch.consumersmoke', + }, + null, + 2 + ) + '\n' + ); + copyFileSync( + join(dirname(fileURLToPath(import.meta.url)), '../../apps/consumer-fixtures/App.smoke.jsx'), + join(directory, 'App.jsx') + ); + writeFileSync( + join(directory, 'metro.config.js'), + `const {getDefaultConfig} = require('expo/metro-config'); +const config = getDefaultConfig(__dirname); +config.resolver.assetExts.push('pte'); +module.exports = config; +` + ); +} diff --git a/.github/consumer-builds/smoke-runner.mjs b/.github/consumer-builds/smoke-runner.mjs new file mode 100644 index 0000000000..09640f2715 --- /dev/null +++ b/.github/consumer-builds/smoke-runner.mjs @@ -0,0 +1,150 @@ +import assert from 'node:assert/strict'; +import { execFile, spawn } from 'node:child_process'; +import { createServer } from 'node:http'; +import { createWriteStream, mkdirSync, readFileSync, writeFileSync } from 'node:fs'; +import { join, resolve } from 'node:path'; +import { promisify } from 'node:util'; +import { pathToFileURL } from 'node:url'; + +const execute = promisify(execFile); + +export async function startReporter(token, port = 18765, timeout = 180000) { + let accept, reject; + const result = new Promise((resolve, fail) => { + accept = resolve; + reject = fail; + }); + // A failure may arrive while native installation/launch is still awaiting. + result.catch(() => {}); + const server = createServer((request, response) => { + if (request.method !== 'POST' || request.url !== `/result/${token}`) { + response.writeHead(404).end(); + return; + } + let body = ''; + request.on('data', (chunk) => { + body += chunk; + if (body.length > 16384) request.destroy(new Error('Smoke report exceeds 16 KB')); + }); + request.on('error', reject); + request.on('end', () => { + try { + const report = JSON.parse(body); + assert.equal(report.status, 'pass', report.error ?? 'App reported failure'); + assert.deepEqual(report.checks, ['tensor', 'worklet', 'model']); + assert.equal(report.inference?.elements, 256 * 256); + assert.ok(report.inference?.backend?.includes('XnnpackBackend')); + response.writeHead(200, { Connection: 'close' }).end('ok'); + accept(report); + } catch (error) { + response.writeHead(400, { Connection: 'close' }).end(String(error)); + reject(error); + } + }); + }); + await new Promise((resolve, reject) => { + server.once('error', reject); + server.listen(port, '127.0.0.1', resolve); + }); + const timer = setTimeout( + () => reject(new Error('App did not report passing smoke assertions before the timeout')), + timeout + ); + return { + port: server.address().port, + result, + close: async () => { + clearTimeout(timer); + await new Promise((resolve) => server.close(resolve)); + }, + }; +} + +async function main() { + const [platform, artifact, consumer, logs] = process.argv.slice(2); + if (!['android', 'ios'].includes(platform) || !artifact || !consumer || !logs) { + throw new Error( + 'Usage: node smoke-runner.mjs android|ios ' + ); + } + mkdirSync(logs, { recursive: true }); + const config = JSON.parse(readFileSync(join(consumer, 'smoke-config.json'), 'utf8')); + const reporter = await startReporter(config.token, config.port); + const output = createWriteStream(join(logs, 'runtime.log')); + let logger, + udid, + bootedByUs = false; + try { + if (platform === 'android') { + await execute('adb', ['install', '-r', resolve(artifact)]); + await execute('adb', ['reverse', `tcp:${config.port}`, `tcp:${config.port}`]); + await execute('adb', ['logcat', '-c']); + logger = spawn('adb', ['logcat', '-v', 'threadtime']); + logger.stdout.pipe(output, { end: false }); + logger.stderr.pipe(output, { end: false }); + await execute('adb', ['shell', 'am', 'force-stop', config.bundleIdentifier]); + await execute('adb', [ + 'shell', + 'am', + 'start', + '-W', + '-n', + `${config.bundleIdentifier}/.MainActivity`, + ]); + } else { + const devices = JSON.parse( + (await execute('xcrun', ['simctl', 'list', 'devices', 'available', '-j'])).stdout + ); + const device = Object.entries(devices.devices) + .filter(([runtime]) => runtime.includes('.iOS-')) + .flatMap(([, devices]) => devices) + .find((device) => device.isAvailable && device.name.startsWith('iPhone')); + if (!device) throw new Error('No available iPhone simulator'); + udid = device.udid; + if (device.state !== 'Booted') { + await execute('xcrun', ['simctl', 'boot', udid]); + bootedByUs = true; + } + await execute('xcrun', ['simctl', 'bootstatus', udid, '-b'], { timeout: 120000 }); + await execute('xcrun', ['simctl', 'install', udid, resolve(artifact)]); + logger = spawn('xcrun', [ + 'simctl', + 'launch', + '--console', + '--terminate-running-process', + udid, + config.bundleIdentifier, + ]); + logger.stdout.pipe(output, { end: false }); + logger.stderr.pipe(output, { end: false }); + } + logger.on('error', (error) => output.write(`Log capture failed: ${error.message}\n`)); + const report = await reporter.result; + writeFileSync(join(logs, 'smoke-result.json'), JSON.stringify(report, null, 2) + '\n'); + console.log( + 'PASS: native tensor, worklet typed-array round trip and bundled XNNPACK inference' + ); + } finally { + logger?.stdout.unpipe(output); + logger?.stderr.unpipe(output); + logger?.kill(); + output.end(); + await reporter.close(); + if (platform === 'android') { + await execute('adb', ['shell', 'am', 'force-stop', config.bundleIdentifier]).catch(() => {}); + await execute('adb', ['reverse', '--remove', `tcp:${config.port}`]).catch(() => {}); + } else if (udid) { + await execute('xcrun', ['simctl', 'terminate', udid, config.bundleIdentifier]).catch( + () => {} + ); + if (bootedByUs) await execute('xcrun', ['simctl', 'shutdown', udid]).catch(() => {}); + } + } +} + +if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) { + main().catch((error) => { + console.error(error); + process.exitCode = 1; + }); +} diff --git a/.github/consumer-builds/smoke-runner.test.mjs b/.github/consumer-builds/smoke-runner.test.mjs new file mode 100644 index 0000000000..80d565312a --- /dev/null +++ b/.github/consumer-builds/smoke-runner.test.mjs @@ -0,0 +1,63 @@ +import assert from 'node:assert/strict'; +import { test } from 'node:test'; +import { startReporter } from './smoke-runner.mjs'; + +const passing = { + status: 'pass', + checks: ['tensor', 'worklet', 'model'], + inference: { elements: 65536, backend: ['XnnpackBackend'] }, +}; + +test('a valid app report passes, and stale tokens cannot pass the collector', async () => { + const reporter = await startReporter('current-build', 0); + try { + const url = `http://127.0.0.1:${reporter.port}/result/`; + assert.equal( + (await fetch(url + 'previous-build', { method: 'POST', body: JSON.stringify(passing) })) + .status, + 404 + ); + assert.equal( + (await fetch(url + 'current-build', { method: 'POST', body: JSON.stringify(passing) })) + .status, + 200 + ); + assert.deepEqual(await reporter.result, passing); + } finally { + await reporter.close(); + } +}); + +for (const report of [ + { ...passing, status: 'fail', error: 'Native assertion failed' }, + { ...passing, checks: ['tensor'] }, + { ...passing, inference: { elements: 0, backend: [] } }, +]) { + test(`CI rejects a failed or incomplete report: ${JSON.stringify(report)}`, async () => { + const reporter = await startReporter('build', 0); + try { + const rejected = assert.rejects(reporter.result); + assert.equal( + ( + await fetch(`http://127.0.0.1:${reporter.port}/result/build`, { + method: 'POST', + body: JSON.stringify(report), + }) + ).status, + 400 + ); + await rejected; + } finally { + await reporter.close(); + } + }); +} + +test('an app crash or missing callback fails with a timeout', async () => { + const reporter = await startReporter('missing-app', 0, 25); + try { + await assert.rejects(reporter.result, /timeout/); + } finally { + await reporter.close(); + } +}); diff --git a/.github/workflows/consumer-builds.yml b/.github/workflows/consumer-builds.yml index 7d35c367b4..8674dac3ae 100644 --- a/.github/workflows/consumer-builds.yml +++ b/.github/workflows/consumer-builds.yml @@ -6,6 +6,7 @@ on: paths: - '.github/workflows/consumer-build*.yml' - '.github/consumer-builds/**' + - 'apps/consumer-fixtures/**' - '.github/actions/setup/**' - 'packages/react-native-executorch/**' - 'package.json' @@ -45,7 +46,7 @@ jobs: - name: Validate consumer harness run: | node --check .github/consumer-builds/prepare.mjs - node --test .github/consumer-builds/matrix.test.mjs + node --test .github/consumer-builds/*.test.mjs - name: Generate version matrices id: matrix env: @@ -92,7 +93,7 @@ jobs: fail-fast: false max-parallel: 4 matrix: ${{ fromJSON(needs.plan.outputs.matrix) }} - runs-on: ${{ matrix.platform == 'ios' && 'macos-26' || 'ubuntu-24.04' }} + runs-on: ${{ matrix.runner }} timeout-minutes: 90 defaults: run: @@ -100,15 +101,27 @@ jobs: env: CI: '1' EXPO_NO_TELEMETRY: '1' + CONSUMER_ABI: ${{ matrix.smoke && matrix.platform == 'android' && 'x86_64' || 'arm64-v8a' }} steps: - name: Set consumer paths + if: runner.os != 'Windows' run: | echo "CONSUMER_DIR=$RUNNER_TEMP/ConsumerBuild" >> "$GITHUB_ENV" echo "LOG_DIR=$RUNNER_TEMP/consumer-logs" >> "$GITHUB_ENV" + - name: Set short Windows consumer paths + if: runner.os == 'Windows' + shell: pwsh + run: | + 'CONSUMER_DIR=C:\rnet\app' | Out-File $env:GITHUB_ENV -Encoding utf8 -Append + "LOG_DIR=$env:RUNNER_TEMP/consumer-logs" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append + git config --global core.longpaths true - uses: actions/checkout@v6 - uses: actions/setup-node@v6 with: node-version-file: .nvmrc + - name: Validate Windows host helpers + if: runner.os == 'Windows' + run: node --test .github/consumer-builds/host.test.mjs - uses: actions/download-artifact@v4 with: name: consumer-library @@ -133,25 +146,37 @@ jobs: distribution: temurin java-version: '17' - name: Use the hosted runner's Android SDK - if: matrix.platform == 'android' + if: matrix.platform == 'android' && runner.os != 'Windows' run: | test -n "$ANDROID_HOME" test -x "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" echo "$ANDROID_HOME/cmdline-tools/latest/bin" >> "$GITHUB_PATH" - name: Record Android toolchain - if: matrix.platform == 'android' + if: matrix.platform == 'android' && runner.os != 'Windows' run: | { java -version sdkmanager --version } 2>&1 | tee -a "$LOG_DIR/toolchain.log" + - name: Use and record the Windows Android SDK + if: runner.os == 'Windows' + shell: pwsh + run: | + New-Item -ItemType Directory -Force $env:LOG_DIR | Out-Null + $tools = Join-Path $env:ANDROID_HOME 'cmdline-tools/latest/bin' + if (!(Test-Path (Join-Path $tools 'sdkmanager.bat'))) { throw 'Android SDK command-line tools are missing' } + $tools | Out-File $env:GITHUB_PATH -Encoding utf8 -Append + & java -version 2>&1 | Tee-Object -FilePath "$env:LOG_DIR/toolchain.log" -Append + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + & (Join-Path $tools 'sdkmanager.bat') --version 2>&1 | Tee-Object -FilePath "$env:LOG_DIR/toolchain.log" -Append + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - name: Create and install the clean consumer run: | node .github/consumer-builds/prepare.mjs '${{ matrix.profile }}' '${{ matrix.platform }}' \ "$RUNNER_TEMP/consumer-package/react-native-executorch.tgz" "$CONSUMER_DIR" \ 2>&1 | tee "$LOG_DIR/install.log" - name: Build Android release with R8 - if: matrix.platform == 'android' + if: matrix.platform == 'android' && runner.os != 'Windows' working-directory: ${{ env.CONSUMER_DIR }}/android run: | ./gradlew :app:assembleRelease --no-daemon --stacktrace --max-workers=2 \ @@ -159,15 +184,33 @@ jobs: apk=app/build/outputs/apk/release/app-release.apk unzip -l "$apk" | tee "$LOG_DIR/apk-files.log" for library in RnExecutorch executorch xnnpack_executorch_backend vulkan_executorch_backend; do - grep -F "lib/arm64-v8a/lib${library}.so" "$LOG_DIR/apk-files.log" + grep -F "lib/${CONSUMER_ABI}/lib${library}.so" "$LOG_DIR/apk-files.log" done cp "$apk" "$LOG_DIR/ConsumerBuild.apk" + - name: Build Android release on Windows with R8 + if: runner.os == 'Windows' + shell: pwsh + working-directory: ${{ env.CONSUMER_DIR }}/android + run: | + & .\gradlew.bat :app:assembleRelease --no-daemon --stacktrace --max-workers=2 2>&1 | Tee-Object -FilePath "$env:LOG_DIR/android.log" + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + $apk = Join-Path $PWD 'app/build/outputs/apk/release/app-release.apk' + Add-Type -AssemblyName System.IO.Compression.ZipFile + $zip = [System.IO.Compression.ZipFile]::OpenRead($apk) + try { + $entries = @($zip.Entries | ForEach-Object { $_.FullName }) + $entries | Out-File "$env:LOG_DIR/apk-files.log" -Encoding utf8 + foreach ($library in @('RnExecutorch', 'executorch', 'xnnpack_executorch_backend', 'vulkan_executorch_backend')) { + if ($entries -notcontains "lib/arm64-v8a/lib$library.so") { throw "APK is missing $library" } + } + } finally { $zip.Dispose() } + Copy-Item $apk "$env:LOG_DIR/ConsumerBuild.apk" - name: Install iOS pods if: matrix.platform == 'ios' working-directory: ${{ env.CONSUMER_DIR }}/ios run: pod install 2>&1 | tee "$LOG_DIR/pods.log" - name: Archive iOS release without signing - if: matrix.platform == 'ios' + if: matrix.platform == 'ios' && !matrix.smoke working-directory: ${{ env.CONSUMER_DIR }} run: | xcodebuild -workspace ios/ConsumerBuild.xcworkspace -scheme ConsumerBuild \ @@ -185,11 +228,41 @@ jobs: test -f "$app/RnExecutorchPrivacyInfo.bundle/PrivacyInfo.xcprivacy" plutil -lint "$app/RnExecutorchPrivacyInfo.bundle/PrivacyInfo.xcprivacy" fi + - name: Build iOS simulator smoke app + if: matrix.platform == 'ios' && matrix.smoke + working-directory: ${{ env.CONSUMER_DIR }} + run: | + xcodebuild -workspace ios/ConsumerBuild.xcworkspace -scheme ConsumerBuild \ + -configuration Release -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' \ + -derivedDataPath "$RUNNER_TEMP/consumer-derived-data" \ + CODE_SIGNING_ALLOWED=NO build 2>&1 | tee "$LOG_DIR/ios.log" + - name: Run iOS native smoke assertions + if: matrix.platform == 'ios' && matrix.smoke + run: | + node .github/consumer-builds/smoke-runner.mjs ios \ + "$RUNNER_TEMP/consumer-derived-data/Build/Products/Release-iphonesimulator/ConsumerBuild.app" \ + "$CONSUMER_DIR" "$LOG_DIR" + - name: Enable Android emulator acceleration + if: matrix.platform == 'android' && matrix.smoke + 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: Run Android native smoke assertions + if: matrix.platform == 'android' && matrix.smoke + uses: reactivecircus/android-emulator-runner@a421e43855164a8197daf9d8d40fe71c6996bb0d + with: + api-level: 34 + arch: x86_64 + target: google_apis + emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true + script: node .github/consumer-builds/smoke-runner.mjs android "${{ env.CONSUMER_DIR }}/android/app/build/outputs/apk/release/app-release.apk" "${{ env.CONSUMER_DIR }}" "${{ env.LOG_DIR }}" - name: Collect consumer configuration if: always() run: | mkdir -p "$LOG_DIR" - for file in consumer-profile.json package.json package-lock.json android/gradle.properties android/build.gradle android/app/build.gradle ios/Podfile ios/Podfile.lock ios/Podfile.properties.json; do + for file in smoke-config.json consumer-profile.json package.json package-lock.json android/gradle.properties android/build.gradle android/app/build.gradle ios/Podfile ios/Podfile.lock ios/Podfile.properties.json; do if [[ -f "$CONSUMER_DIR/$file" ]]; then destination="$LOG_DIR/config/$file" mkdir -p "$(dirname "$destination")" @@ -202,7 +275,7 @@ jobs: - uses: actions/upload-artifact@v4 if: always() with: - name: consumer-build-${{ matrix.profile }}-${{ matrix.platform }} + name: consumer-build-${{ matrix.id }} path: ${{ env.LOG_DIR }} if-no-files-found: warn retention-days: 7 diff --git a/.github/consumer-builds/App.jsx b/apps/consumer-fixtures/App.jsx similarity index 100% rename from .github/consumer-builds/App.jsx rename to apps/consumer-fixtures/App.jsx diff --git a/apps/consumer-fixtures/App.smoke.jsx b/apps/consumer-fixtures/App.smoke.jsx new file mode 100644 index 0000000000..f6109a6c85 --- /dev/null +++ b/apps/consumer-fixtures/App.smoke.jsx @@ -0,0 +1,102 @@ +import React, { useEffect, useState } from 'react'; +import { SafeAreaView, Text } from 'react-native'; +import { Asset } from 'expo-asset'; +import { loadModel, math, setTelemetryEnabled, tensor, wrapAsync } from 'react-native-executorch'; +import config from './smoke-config.json'; + +function check(condition, message) { + 'worklet'; + if (!condition) throw new Error(message); +} + +async function runSmoke() { + setTelemetryEnabled(false); + const checks = []; + const input = tensor('float32', [3], new Float32Array([1, 2, 3])); + const output = tensor('float32', [3]); + try { + math.softmax(input, output); + const result = output.getData(new Float32Array(3)); + const expected = [0.09003057, 0.24472847, 0.66524096]; + check( + result.every((value, i) => Math.abs(value - expected[i]) < 1e-5), + 'Native softmax returned incorrect values' + ); + checks.push('tensor'); + } finally { + output.dispose(); + input.dispose(); + } + + const backing = new Float32Array([99, 1, 2, 3, 99]); + const view = new Float32Array(backing.buffer, 4, 3); + const values = await wrapAsync((data) => { + 'worklet'; + check( + data.length === 3 && data[0] === 1 && data[2] === 3, + 'Worklet serialization changed the typed-array view' + ); + const t = tensor('float32', [3], data); + try { + return Array.from(t.getData(new Float32Array(3))); + } finally { + t.dispose(); + } + })(view); + check(values.join(',') === '1,2,3', 'Worklet native tensor round trip failed'); + checks.push('worklet'); + + const asset = Asset.fromModule(require('./smoke-model.pte')); + await asset.downloadAsync(); + check(asset.localUri?.startsWith('file://'), 'Bundled model did not resolve to a local file'); + const modelPath = decodeURIComponent(asset.localUri.slice('file://'.length)); + const inference = await wrapAsync((path) => { + 'worklet'; + let model, src, dst; + try { + model = loadModel(path); + check( + model.backends.forward.includes('XnnpackBackend'), + 'Fixture did not load the XNNPACK backend' + ); + src = tensor('float32', [1, 3, 256, 256], new Float32Array(3 * 256 * 256)); + // A no-op inference must not pass because of a zero-initialized buffer. + dst = tensor('float32', [1, 1, 256, 256], new Float32Array(256 * 256).fill(NaN)); + model.execute('forward', [src], [dst]); + const result = dst.getData(new Float32Array(256 * 256)); + check( + result.every((v) => Number.isFinite(v) && v >= 0 && v <= 1), + 'Inference did not write finite probabilities to every output' + ); + return { elements: result.length, backend: model.backends.forward }; + } finally { + dst?.dispose(); + src?.dispose(); + model?.dispose(); + } + })(modelPath); + checks.push('model'); + return { status: 'pass', checks, inference }; +} + +export default function App() { + const [status, setStatus] = useState('Running native smoke tests'); + useEffect(() => { + runSmoke() + .catch((error) => ({ status: 'fail', error: String(error?.stack ?? error) })) + .then(async (result) => { + setStatus(JSON.stringify(result)); + await fetch(`http://127.0.0.1:${config.port}/result/${config.token}`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(result), + }); + }) + .catch((error) => setStatus(`Reporting failed: ${String(error)}`)); + }, []); + return ( + + {status} + + ); +} From 8e25814a9208dfec7611f99487cc7c118c5dd46f Mon Sep 17 00:00:00 2001 From: Bartosz Hanc Date: Thu, 12 Nov 2026 17:39:58 +0100 Subject: [PATCH 5/7] ci: allow consumer builds to request runners independently --- .github/consumer-builds/README.md | 4 ++-- .github/workflows/consumer-builds.yml | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/consumer-builds/README.md b/.github/consumer-builds/README.md index 3520d8718c..96c2f133bd 100644 --- a/.github/consumer-builds/README.md +++ b/.github/consumer-builds/README.md @@ -40,8 +40,8 @@ expands it across Android and iOS. One workflow plans, packs and builds them. validation; the broader bare RN matrix remains manual. Each run also has one planning/test job and one shared library build/package job: -**13 jobs for regular coverage, 45 for manual full coverage**, with at most four -app builds concurrently. The table above shows the complete manual matrix. +**13 jobs for regular coverage, 45 for manual full coverage**. Matrix jobs can +run concurrently, subject to GitHub runner availability and organization limits. The table above shows the complete manual matrix. The compatibility rules match the pinned Worklets packages' published RN peer ranges. For example, Worklets 0.13 supports RN 0.86–0.88, whereas 0.12 supports diff --git a/.github/workflows/consumer-builds.yml b/.github/workflows/consumer-builds.yml index 8674dac3ae..977896039c 100644 --- a/.github/workflows/consumer-builds.yml +++ b/.github/workflows/consumer-builds.yml @@ -91,7 +91,6 @@ jobs: name: ${{ matrix.id }} strategy: fail-fast: false - max-parallel: 4 matrix: ${{ fromJSON(needs.plan.outputs.matrix) }} runs-on: ${{ matrix.runner }} timeout-minutes: 90 From 63674e130832dbadaeb4f059cf365b519236f867 Mon Sep 17 00:00:00 2001 From: Bartosz Hanc Date: Thu, 12 Nov 2026 18:39:29 +0100 Subject: [PATCH 6/7] ci: allow cold simulator boot before starting smoke deadline --- .github/consumer-builds/README.md | 4 ++ .github/consumer-builds/smoke-runner.mjs | 53 ++++++++++++++----- .github/consumer-builds/smoke-runner.test.mjs | 32 +++++++++-- 3 files changed, 73 insertions(+), 16 deletions(-) diff --git a/.github/consumer-builds/README.md b/.github/consumer-builds/README.md index 96c2f133bd..65e0ba1405 100644 --- a/.github/consumer-builds/README.md +++ b/.github/consumer-builds/README.md @@ -105,6 +105,10 @@ A loopback HTTP collector waits for a report containing all three assertions and a per-build random token. App crashes, missing reports, assertion failures and incomplete reports fail CI. The reporter's own tests verify those failure paths. Android reaches the collector through `adb reverse`; iOS uses simulator loopback. +Simulator boot has a separate ten-minute deadline to allow first-boot data +migration. The three-minute assertion deadline starts immediately before app +launch, after boot and installation. Simulator boot output is saved in +`simulator-boot.log`; cleanup commands are limited to fifteen seconds each. Cleartext loopback access is enabled only in the smoke fixtures. Native/runtime logs and the successful report are retained in the cell's artifact. diff --git a/.github/consumer-builds/smoke-runner.mjs b/.github/consumer-builds/smoke-runner.mjs index 09640f2715..4657e2906f 100644 --- a/.github/consumer-builds/smoke-runner.mjs +++ b/.github/consumer-builds/smoke-runner.mjs @@ -46,13 +46,17 @@ export async function startReporter(token, port = 18765, timeout = 180000) { server.once('error', reject); server.listen(port, '127.0.0.1', resolve); }); - const timer = setTimeout( - () => reject(new Error('App did not report passing smoke assertions before the timeout')), - timeout - ); + let timer; return { port: server.address().port, - result, + // Booting and installing are setup; only app execution uses this deadline. + waitForReport: () => { + timer ??= setTimeout( + () => reject(new Error('App did not report passing smoke assertions before the timeout')), + timeout + ); + return result; + }, close: async () => { clearTimeout(timer); await new Promise((resolve) => server.close(resolve)); @@ -83,6 +87,7 @@ async function main() { logger.stdout.pipe(output, { end: false }); logger.stderr.pipe(output, { end: false }); await execute('adb', ['shell', 'am', 'force-stop', config.bundleIdentifier]); + reporter.waitForReport(); await execute('adb', [ 'shell', 'am', @@ -105,8 +110,22 @@ async function main() { await execute('xcrun', ['simctl', 'boot', udid]); bootedByUs = true; } - await execute('xcrun', ['simctl', 'bootstatus', udid, '-b'], { timeout: 120000 }); + console.log(`Waiting up to 10 minutes for simulator ${device.name} (${udid})`); + try { + const boot = await execute('xcrun', ['simctl', 'bootstatus', udid, '-b'], { + timeout: 600000, + maxBuffer: 8 * 1024 * 1024, + }); + writeFileSync(join(logs, 'simulator-boot.log'), boot.stdout + boot.stderr); + } catch (error) { + writeFileSync( + join(logs, 'simulator-boot.log'), + `${error.stdout ?? ''}${error.stderr ?? ''}\n${error.message}\n` + ); + throw error; + } await execute('xcrun', ['simctl', 'install', udid, resolve(artifact)]); + reporter.waitForReport(); logger = spawn('xcrun', [ 'simctl', 'launch', @@ -119,7 +138,7 @@ async function main() { logger.stderr.pipe(output, { end: false }); } logger.on('error', (error) => output.write(`Log capture failed: ${error.message}\n`)); - const report = await reporter.result; + const report = await reporter.waitForReport(); writeFileSync(join(logs, 'smoke-result.json'), JSON.stringify(report, null, 2) + '\n'); console.log( 'PASS: native tensor, worklet typed-array round trip and bundled XNNPACK inference' @@ -131,13 +150,21 @@ async function main() { output.end(); await reporter.close(); if (platform === 'android') { - await execute('adb', ['shell', 'am', 'force-stop', config.bundleIdentifier]).catch(() => {}); - await execute('adb', ['reverse', '--remove', `tcp:${config.port}`]).catch(() => {}); + await execute('adb', ['shell', 'am', 'force-stop', config.bundleIdentifier], { + timeout: 15000, + }).catch(() => {}); + await execute('adb', ['reverse', '--remove', `tcp:${config.port}`], { + timeout: 15000, + }).catch(() => {}); } else if (udid) { - await execute('xcrun', ['simctl', 'terminate', udid, config.bundleIdentifier]).catch( - () => {} - ); - if (bootedByUs) await execute('xcrun', ['simctl', 'shutdown', udid]).catch(() => {}); + await execute('xcrun', ['simctl', 'terminate', udid, config.bundleIdentifier], { + timeout: 15000, + }).catch(() => {}); + if (bootedByUs) { + await execute('xcrun', ['simctl', 'shutdown', udid], { timeout: 15000 }).catch( + () => {} + ); + } } } } diff --git a/.github/consumer-builds/smoke-runner.test.mjs b/.github/consumer-builds/smoke-runner.test.mjs index 80d565312a..6bfd7bc54b 100644 --- a/.github/consumer-builds/smoke-runner.test.mjs +++ b/.github/consumer-builds/smoke-runner.test.mjs @@ -22,7 +22,7 @@ test('a valid app report passes, and stale tokens cannot pass the collector', as .status, 200 ); - assert.deepEqual(await reporter.result, passing); + assert.deepEqual(await reporter.waitForReport(), passing); } finally { await reporter.close(); } @@ -36,7 +36,7 @@ for (const report of [ test(`CI rejects a failed or incomplete report: ${JSON.stringify(report)}`, async () => { const reporter = await startReporter('build', 0); try { - const rejected = assert.rejects(reporter.result); + const rejected = assert.rejects(reporter.waitForReport()); assert.equal( ( await fetch(`http://127.0.0.1:${reporter.port}/result/build`, { @@ -56,8 +56,34 @@ for (const report of [ test('an app crash or missing callback fails with a timeout', async () => { const reporter = await startReporter('missing-app', 0, 25); try { - await assert.rejects(reporter.result, /timeout/); + await assert.rejects(reporter.waitForReport(), /timeout/); } finally { await reporter.close(); } }); + + +test('simulator setup does not consume the app deadline, and waiting again does not reset it', async (t) => { + t.mock.timers.enable({ apis: ['setTimeout'] }); + const reporter = await startReporter('cold-boot', 0, 100); + try { + // A cold simulator may spend minutes migrating before the app can launch. + t.mock.timers.tick(600000); + const result = reporter.waitForReport(); + let settled = false; + result.then( + () => { settled = true; }, + () => { settled = true; } + ); + t.mock.timers.tick(99); + await Promise.resolve(); + assert.equal(settled, false, 'setup time must not expire the app deadline'); + assert.equal(reporter.waitForReport(), result); + const rejected = assert.rejects(result, /timeout/); + t.mock.timers.tick(1); + await rejected; + } finally { + await reporter.close(); + t.mock.timers.reset(); + } +}); From 0931f6b759eaa04d300bb97a9ee6c81859b09c1d Mon Sep 17 00:00:00 2001 From: Bartosz Hanc Date: Fri, 13 Nov 2026 11:51:31 +0100 Subject: [PATCH 7/7] ci: validate Android bundles and Expo plugin coexistence --- .agents/skills/verify-and-build/SKILL.md | 3 +- .github/consumer-builds/README.md | 88 ++++++++++++----- .github/consumer-builds/compatibility.json | 8 +- .../consumer-builds/integration-fixture.mjs | 97 +++++++++++++++++++ .github/consumer-builds/matrix.mjs | 30 +++++- .github/consumer-builds/matrix.test.mjs | 32 +++++- .github/consumer-builds/prepare.mjs | 20 +++- .github/consumer-builds/validate-aab.mjs | 79 +++++++++++++++ .github/consumer-builds/validate-aab.test.mjs | 27 ++++++ .github/workflows/consumer-builds.yml | 15 ++- apps/consumer-fixtures/App.integration.jsx | 21 ++++ 11 files changed, 380 insertions(+), 40 deletions(-) create mode 100644 .github/consumer-builds/integration-fixture.mjs create mode 100644 .github/consumer-builds/validate-aab.mjs create mode 100644 .github/consumer-builds/validate-aab.test.mjs create mode 100644 apps/consumer-fixtures/App.integration.jsx diff --git a/.agents/skills/verify-and-build/SKILL.md b/.agents/skills/verify-and-build/SKILL.md index e49e225242..fb13aaeeb4 100644 --- a/.agents/skills/verify-and-build/SKILL.md +++ b/.agents/skills/verify-and-build/SKILL.md @@ -111,7 +111,8 @@ phoneme output. Use device/emulator integration for those behaviors. The [consumer build matrix](../../../.github/consumer-builds/README.md) checks a packed library in fresh bare RN and Expo applications on Android and iOS. It runs Expo profiles on relevant PRs, including Windows-hosted Android and two -emulator/simulator runtime smoke cells. Manual dispatch can also select the full +emulator/simulator runtime smoke cells, Android AAB validation, and Expo +config-plugin integration builds for Sentry, Firebase, Vision Camera and audio-api. Manual dispatch can also select the full bare RN/Worklets matrix. Use it for publication, installation, autolinking, release bundling and native build regressions. Only the smoke cells launch apps and verify a bundled diff --git a/.github/consumer-builds/README.md b/.github/consumer-builds/README.md index 65e0ba1405..2af0b869dd 100644 --- a/.github/consumer-builds/README.md +++ b/.github/consumer-builds/README.md @@ -1,6 +1,6 @@ # Consumer build matrix - + The [Consumer builds workflow](../workflows/consumer-builds.yml) installs one published-format library tarball into fresh consumer applications outside the @@ -14,33 +14,35 @@ pinned Worklets release, pinned RN patches and peer versions, and the Expo fixtures. [matrix.mjs](./matrix.mjs) generates every declared compatible pair and expands it across Android and iOS. One workflow plans, packs and builds them. -| React Native | Compatible Worklets pins | Release app builds | -| ---------------------------- | -------------------------------------------- | ------------------ | -| 0.83.6 | 0.10.4, 0.11.4, 0.12.2 | 6 | -| 0.84.1 | 0.10.4, 0.11.4, 0.12.2 | 6 | -| 0.85.3 | 0.10.4, 0.11.4, 0.12.2 | 6 | -| 0.86.3 | 0.10.4, 0.11.4, 0.12.2, 0.13.0 | 8 | -| 0.87.1 | 0.12.2, 0.13.0 | 4 | -| 0.88.1 | 0.13.0 | 2 | -| Expo 55.0.32 / RN 0.83.10 | 0.10.4 | 2 | -| Expo 56.0.24 / RN 0.85.3 | 0.10.4 | 2 | -| Expo 57.0.28 / RN 0.86.3 | 0.13.0 | 2 | -| Expo 58.0.24 / RN 0.88.1 | 0.13.0 | 2 | -| Latest Expo, Windows Android | Same versions as the latest SDK | 1 | -| Latest Expo, runtime smoke | Same versions as the latest SDK | 2 | -| **Total** | **32 bare + 8 Expo + 1 Windows + 2 runtime** | **43** | - -- **Relevant pull requests:** eleven app builds: eight SDK/platform builds, +| React Native | Compatible Worklets pins | Release app builds | +| ---------------------------- | ------------------------------------------------------------ | ------------------ | +| 0.83.6 | 0.10.4, 0.11.4, 0.12.2 | 6 | +| 0.84.1 | 0.10.4, 0.11.4, 0.12.2 | 6 | +| 0.85.3 | 0.10.4, 0.11.4, 0.12.2 | 6 | +| 0.86.3 | 0.10.4, 0.11.4, 0.12.2, 0.13.0 | 8 | +| 0.87.1 | 0.12.2, 0.13.0 | 4 | +| 0.88.1 | 0.13.0 | 2 | +| Expo 55.0.32 / RN 0.83.10 | 0.10.4 | 2 | +| Expo 56.0.24 / RN 0.85.3 | 0.10.4 | 2 | +| Expo 57.0.28 / RN 0.86.3 | 0.13.0 | 2 | +| Expo 58.0.24 / RN 0.88.1 | 0.13.0 | 2 | +| Latest Expo, Windows Android | Same versions as the latest SDK | 1 | +| Latest Expo, runtime smoke | Same versions as the latest SDK | 2 | +| Latest Expo, integrations | Sentry, Firebase, Vision Camera, audio-api | 2 | +| **Total** | **32 bare + 8 Expo + 1 Windows + 2 runtime + 2 integration** | **45** | + +- **Relevant pull requests:** thirteen app builds: eight SDK/platform builds, one additional Expo 58 Android build on Windows, and two latest-Expo runtime - smoke apps (Android emulator on Linux, iOS simulator on macOS). -- **Manual dispatch:** `expo` (the default) runs those eleven builds; `full` - adds all 32 bare RN/Worklets builds for **43 app builds**. Use `full` for + smoke apps (Android emulator on Linux, iOS simulator on macOS), plus two + latest-Expo integration builds. +- **Manual dispatch:** `expo` (the default) runs those thirteen builds; `full` + adds all 32 bare RN/Worklets builds for **45 app builds**. Use `full` for releases, native changes and compatibility investigations. - **No scheduled runs yet.** A TODO tracks considering daily Expo coverage after validation; the broader bare RN matrix remains manual. Each run also has one planning/test job and one shared library build/package job: -**13 jobs for regular coverage, 45 for manual full coverage**. Matrix jobs can +**15 jobs for regular coverage, 47 for manual full coverage**. Matrix jobs can run concurrently, subject to GitHub runner availability and organization limits. The table above shows the complete manual matrix. The compatibility rules match the pinned Worklets packages' published RN peer @@ -67,7 +69,7 @@ intentionally has no package manifest and is not a workspace. CI helpers stay in `.github/consumer-builds/`. Preparation copies the app source into an isolated consumer outside the repository. -Framework linkage variants, backend subsets, Debug, RN nightly, EAS and OTA +Other framework linkage variants, backend subsets, Debug, RN nightly, EAS and OTA remain separate coverage to add. ## What it checks @@ -87,6 +89,35 @@ All optional native libraries for the selected platform are enabled. Postinstall fetches only that platform via `RNET_TARGET`. This does not test cross-host Expo fingerprint equality or backend opt-outs. +## Production packaging and integration coverage + +The latest regular Expo Android/Linux cell also runs `bundleRelease`, reusing +its compiled app. A pinned, SHA-256-verified bundletool validates the AAB; checks +require the JS bundle, dex, manifest, and arm64 RNE, ExecuTorch, XNNPACK and +Vulkan libraries. The AAB and validation logs are retained. This checks bundle +packaging, not Play Store upload acceptance or production signing. + +Two latest-Expo build-only cells install Sentry 8.35.0, React Native Firebase +27.1.1 (App), Vision Camera 4.7.3, and audio-api 0.13.6 alongside RNE and Worklets. +Versions live in `compatibility.json`. Audio-api matches the repository apps; +Vision Camera 4 includes the Expo config plugin (version 5 does not ship it). +All four config plugins run during prebuild. Checks verify generated camera and +microphone permissions, iOS background audio, Firebase service configuration, +Sentry build hooks, and dynamic iOS frameworks required by Firebase 27. The app +references each library so Release bundling resolves its JS; native builds check +autolinking and linking on both platforms. + +Firebase configuration is synthetic and points to no real project. Sentry uses +its Expo Metro integration, with upload disabled for these credential-free +builds. These cells do not launch the app or test service connectivity, camera +capture, audio recording, or telemetry delivery. + +This extends #1609 with Android AAB packaging, iOS camera/audio build coexistence, +and Expo config-plugin coexistence. Linux/Windows hosts and bundled `.pte` are +already covered separately; EAS, OTA delivery and App Store upload validation +remain outstanding. Split combined checklist rows before marking only their +covered parts complete. + ## Runtime smoke checks Only the two latest-Expo smoke cells launch an app. They assert: @@ -139,12 +170,17 @@ Adjust the tarball filename to the package version. For iOS, pass `ios` instead of `android`, run `pod install` in the generated `ios/` directory, then use the workflow's archive command. `expo-55`, `expo-56`, `expo-57` and `expo-58` work on either platform. iOS app deployment targets are at least 17.0, preserving a higher RN requirement. +Use `expo-58-integration` for the plugin fixture, setting +`SENTRY_DISABLE_AUTO_UPLOAD=true` when running native builds. +To reproduce AAB coverage, run `:app:bundleRelease` in the regular latest-Expo +Android project and use `validate-aab.mjs ` from +the checkout with Java 17 on PATH. Compatibility data pins the framework, Worklets, blob-util and CLI; other template and transitive dependencies are resolved on each run. Every cell retains its resolved profile, npm lockfile, Gradle files, Podfile configuration and lockfile when present, native library configuration and logs in a seven-day artifact. Android artifacts also -contain the APK; full iOS archives are not uploaded. No successful-build marker +contain the APK and, for the AAB cell, the app bundle; full iOS archives are not uploaded. No successful-build marker cache skips compilation of a new library commit. ## Maintain the matrix @@ -154,7 +190,9 @@ published npm peer requirements. Every configured RN minor must have a compatibl Worklets version, every Worklets RN declaration must name a configured RN minor, and Expo must use a declared compatible pair. The newest Expo profile also pins `expoAsset` for the bundled-model smoke app. Windows and runtime cells follow -that newest profile automatically. The tests verify full combination +that newest profile automatically, as do the integration cells and AAB selection. +Review the `integrations` pins against the new RN/Expo versions when upgrading; +repeat both platform builds to establish compatibility. The tests verify full combination coverage, unique artifact ids, default host/runtime selection and smoke report failures. The planning job reports the actual build count in the GitHub job summary; update the table and expected counts in the tests when changing support. diff --git a/.github/consumer-builds/compatibility.json b/.github/consumer-builds/compatibility.json index d6ba9e0879..e24bf70ef4 100644 --- a/.github/consumer-builds/compatibility.json +++ b/.github/consumer-builds/compatibility.json @@ -96,5 +96,11 @@ "version": "0.13.0", "reactNative": ["0.86", "0.87", "0.88"] } - ] + ], + "integrations": { + "@sentry/react-native": "8.35.0", + "@react-native-firebase/app": "27.1.1", + "react-native-vision-camera": "4.7.3", + "react-native-audio-api": "0.13.6" + } } diff --git a/.github/consumer-builds/integration-fixture.mjs b/.github/consumer-builds/integration-fixture.mjs new file mode 100644 index 0000000000..4f1829138e --- /dev/null +++ b/.github/consumer-builds/integration-fixture.mjs @@ -0,0 +1,97 @@ +import assert from 'node:assert/strict'; +import { copyFileSync, readFileSync, writeFileSync } from 'node:fs'; +import { join } from 'node:path'; + +export const integrationPlugins = [ + ['@sentry/react-native/expo', { organization: 'consumer-fixture', project: 'consumer-fixture' }], + '@react-native-firebase/app', + ['react-native-vision-camera', { enableMicrophonePermission: true }], + [ + 'react-native-audio-api', + { + iosBackgroundMode: true, + iosMicrophonePermission: 'Consumer compatibility fixture microphone access.', + androidPermissions: [ + 'android.permission.RECORD_AUDIO', + 'android.permission.MODIFY_AUDIO_SETTINGS', + ], + }, + ], +]; + +export function prepareIntegrationFixture(directory, appFixtures, bundleIdentifier) { + copyFileSync(join(appFixtures, 'App.integration.jsx'), join(directory, 'App.jsx')); + // Deliberately synthetic build inputs: no Firebase project, services or credentials. + writeFileSync( + join(directory, 'google-services.json'), + JSON.stringify( + { + project_info: { project_number: '123456789012', project_id: 'rnet-consumer-fixture' }, + client: [ + { + client_info: { + mobilesdk_app_id: '1:123456789012:android:0123456789abcdef', + android_client_info: { package_name: bundleIdentifier }, + }, + api_key: [{ current_key: 'AIzaSy' + '0'.repeat(33) }], + }, + ], + configuration_version: '1', + }, + null, + 2 + ) + '\n' + ); + writeFileSync( + join(directory, 'GoogleService-Info.plist'), + ` + + +API_KEYAIzaSy${'0'.repeat(33)} +GCM_SENDER_ID123456789012 +PLIST_VERSION1 +BUNDLE_ID${bundleIdentifier} +PROJECT_IDrnet-consumer-fixture +GOOGLE_APP_ID1:123456789012:ios:0123456789abcdef +IS_ANALYTICS_ENABLED + +` + ); + writeFileSync( + join(directory, 'metro.config.js'), + `const { getSentryExpoConfig } = require('@sentry/react-native/metro'); +module.exports = getSentryExpoConfig(__dirname); +` + ); +} + +export function verifyIntegrationFixture(directory, platform) { + const read = (file) => readFileSync(join(directory, file), 'utf8'); + if (platform === 'android') { + const manifest = read('android/app/src/main/AndroidManifest.xml'); + for (const permission of ['CAMERA', 'RECORD_AUDIO', 'MODIFY_AUDIO_SETTINGS']) { + assert.ok(manifest.includes(`android.permission.${permission}`), `Missing ${permission}`); + } + assert.ok(read('android/app/build.gradle').includes('com.google.gms.google-services')); + assert.ok(read('android/app/build.gradle').includes('sentry.gradle')); + assert.equal( + JSON.parse(read('android/app/google-services.json')).project_info.project_id, + 'rnet-consumer-fixture' + ); + } else { + const info = read('ios/ConsumerBuild/Info.plist'); + for (const key of [ + 'NSCameraUsageDescription', + 'NSMicrophoneUsageDescription', + 'UIBackgroundModes', + ]) { + assert.ok(info.includes(`${key}`), `Missing ${key}`); + } + assert.ok(info.includes('audio')); + assert.equal(JSON.parse(read('ios/Podfile.properties.json'))['ios.useFrameworks'], 'dynamic'); + const project = read('ios/ConsumerBuild.xcodeproj/project.pbxproj'); + assert.ok(project.includes('GoogleService-Info.plist')); + assert.ok(project.includes('sentry-xcode.sh')); + } + console.log(`PASS: ${platform} integration config plugins modified the generated native project`); +} diff --git a/.github/consumer-builds/matrix.mjs b/.github/consumer-builds/matrix.mjs index 15a432ca26..c2ead585b9 100644 --- a/.github/consumer-builds/matrix.mjs +++ b/.github/consumer-builds/matrix.mjs @@ -95,20 +95,38 @@ export function createProfiles(config = readCompatibility()) { requireVersion(latestExpo.expoAsset, `${latestExpo.id}.expoAsset`); const smoke = { ...latestExpo, id: `${latestExpo.id}-smoke`, smoke: true }; requireId(smoke.id); - return { bare, expo, smoke }; + for (const [name, version] of Object.entries(config.integrations ?? {})) { + requireVersion(version, `integrations.${name}`); + } + for (const name of [ + '@sentry/react-native', + '@react-native-firebase/app', + 'react-native-vision-camera', + 'react-native-audio-api', + ]) { + requireVersion(config.integrations?.[name], `integrations.${name}`); + } + const integration = { + ...latestExpo, + id: `${latestExpo.id}-integration`, + integrations: config.integrations, + }; + requireId(integration.id); + return { bare, expo, smoke, integration }; } export function findProfile(id) { - const { bare, expo, smoke } = createProfiles(); - const profile = [...bare, ...expo, smoke].find((profile) => profile.id === id); + const { bare, expo, smoke, integration } = createProfiles(); + const profile = [...bare, ...expo, smoke, integration].find((profile) => profile.id === id); if (!profile) throw new Error(`Unknown consumer profile: ${id}`); return profile; } export function createMatrix(scope = 'expo', config = readCompatibility()) { if (!['expo', 'full'].includes(scope)) throw new Error(`Unknown matrix scope: ${scope}`); - const { bare, expo, smoke } = createProfiles(config); - const profiles = scope === 'full' ? [...bare, ...expo, smoke] : [...expo, smoke]; + const { bare, expo, smoke, integration } = createProfiles(config); + const profiles = + scope === 'full' ? [...bare, ...expo, smoke, integration] : [...expo, smoke, integration]; const latestExpo = [...expo].sort((a, b) => compareVersions(a.expo, b.expo)).at(-1); return { scope, @@ -121,6 +139,7 @@ export function createMatrix(scope = 'expo', config = readCompatibility()) { id: `${profile.id}-${platform}`, runner: platform === 'ios' ? 'macos-26' : 'ubuntu-24.04', smoke: Boolean(profile.smoke), + aab: profile.id === latestExpo.id && platform === 'android', })) ), { @@ -129,6 +148,7 @@ export function createMatrix(scope = 'expo', config = readCompatibility()) { id: `${latestExpo.id}-android-windows`, runner: 'windows-2025', smoke: false, + aab: false, }, ], }, diff --git a/.github/consumer-builds/matrix.test.mjs b/.github/consumer-builds/matrix.test.mjs index 61cb9c922f..fd3892c20b 100644 --- a/.github/consumer-builds/matrix.test.mjs +++ b/.github/consumer-builds/matrix.test.mjs @@ -7,7 +7,7 @@ import { test } from 'node:test'; import { fileURLToPath } from 'node:url'; import { createMatrix, createProfiles, findProfile, readCompatibility } from './matrix.mjs'; -test('default coverage includes Expo SDKs, one Windows build and two runtime smoke apps', () => { +test('default coverage includes Expo SDKs, Windows, runtime smoke and integration apps', () => { const { scope, matrix } = createMatrix(); assert.equal(scope, 'expo'); assert.deepEqual( @@ -23,6 +23,8 @@ test('default coverage includes Expo SDKs, one Windows build and two runtime smo 'expo-58-ios', 'expo-58-smoke-android', 'expo-58-smoke-ios', + 'expo-58-integration-android', + 'expo-58-integration-ios', 'expo-58-android-windows', ] ); @@ -36,8 +38,8 @@ test('the full matrix builds every declared compatible pair on both platforms', expo.map((p) => p.id), ['expo-55', 'expo-56', 'expo-57', 'expo-58'] ); - assert.equal(matrix.include.length, 43); - assert.equal(matrix.include.filter((cell) => cell.profile.startsWith('expo-')).length, 11); + assert.equal(matrix.include.length, 45); + assert.equal(matrix.include.filter((cell) => cell.profile.startsWith('expo-')).length, 13); const expected = { 0.83: ['0.10', '0.11', '0.12'], 0.84: ['0.10', '0.11', '0.12'], @@ -115,8 +117,8 @@ test('the CLI writes single-line JSON matrices usable by GitHub job outputs', () }) ); assert.equal(outputs.scope, 'expo'); - assert.equal(JSON.parse(outputs.matrix).include.length, 11); - assert.match(readFileSync(summary, 'utf8'), /11 Release app builds: 6 Android and 5 iOS/); + assert.equal(JSON.parse(outputs.matrix).include.length, 13); + assert.match(readFileSync(summary, 'utf8'), /13 Release app builds: 7 Android and 6 iOS/); } finally { rmSync(directory, { recursive: true, force: true }); } @@ -135,6 +137,7 @@ test('Windows coverage stays on the newest Expo SDK regardless of configuration id: 'expo-58-android-windows', runner: 'windows-2025', smoke: false, + aab: false, }, ]); const smoke = createMatrix().matrix.include.filter((cell) => cell.smoke); @@ -144,3 +147,22 @@ test('Windows coverage stays on the newest Expo SDK regardless of configuration ); assert.ok(smoke.every((cell) => cell.profile === 'expo-58-smoke')); }); + +test('integration pins are exact, cover both platforms and follow the newest Expo; only one cell builds AAB', () => { + const config = readCompatibility(); + config.expo.reverse(); + const matrix = createMatrix('expo', config).matrix.include; + const integration = matrix.filter((cell) => cell.profile.endsWith('-integration')); + assert.deepEqual( + integration.map((cell) => cell.platform), + ['android', 'ios'] + ); + assert.ok(integration.every((cell) => cell.profile === 'expo-58-integration')); + assert.equal(findProfile('expo-58-integration').integrations['react-native-audio-api'], '0.13.6'); + assert.deepEqual( + matrix.filter((cell) => cell.aab).map((cell) => cell.id), + ['expo-58-android'] + ); + config.integrations['@sentry/react-native'] = '^8.35.0'; + assert.throws(() => createMatrix('expo', config), /Pin integrations/); +}); diff --git a/.github/consumer-builds/prepare.mjs b/.github/consumer-builds/prepare.mjs index 3eef2c5927..ec9b338130 100644 --- a/.github/consumer-builds/prepare.mjs +++ b/.github/consumer-builds/prepare.mjs @@ -14,6 +14,11 @@ import { fileURLToPath } from 'node:url'; import { findProfile } from './matrix.mjs'; import { isInside, packageManagerCommand } from './host.mjs'; import { prepareSmokeFixture } from './smoke-fixture.mjs'; +import { + integrationPlugins, + prepareIntegrationFixture, + verifyIntegrationFixture, +} from './integration-fixture.mjs'; const fixtures = dirname(fileURLToPath(import.meta.url)); const repository = resolve(fixtures, '../..'); @@ -148,6 +153,7 @@ AppRegistry.registerComponent('ConsumerBuild', () => App); 'react-native-worklets': profile.worklets, 'react-native-blob-util': profile.blobUtil, ...(profile.smoke ? { 'expo-asset': profile.expoAsset } : {}), + ...profile.integrations, }, devDependencies: { '@babel/core': profile.babelCore, 'babel-preset-expo': profile.babelPreset }, }; @@ -161,16 +167,23 @@ AppRegistry.registerComponent('ConsumerBuild', () => App); version: '1.0.0', ios: { bundleIdentifier, + ...(profile.integrations ? { googleServicesFile: './GoogleService-Info.plist' } : {}), ...(profile.smoke ? { infoPlist: { NSAppTransportSecurity: { NSAllowsArbitraryLoads: true } } } : {}), }, - android: { package: bundleIdentifier }, + android: { + package: bundleIdentifier, + ...(profile.integrations ? { googleServicesFile: './google-services.json' } : {}), + }, plugins: [ [ 'expo-build-properties', { - ios: { deploymentTarget: '17.0' }, + ios: { + deploymentTarget: '17.0', + ...(profile.integrations ? { useFrameworks: 'dynamic' } : {}), + }, android: { minSdkVersion: 26, buildArchs: [abi], @@ -179,6 +192,7 @@ AppRegistry.registerComponent('ConsumerBuild', () => App); }, }, ], + ...(profile.integrations ? integrationPlugins : []), ], }, }, @@ -195,6 +209,7 @@ registerRootComponent(App); ); copyFileSync(join(appFixtures, 'App.jsx'), join(directory, 'App.jsx')); if (profile.smoke) await prepareSmokeFixture(directory); + if (profile.integrations) prepareIntegrationFixture(directory, appFixtures, bundleIdentifier); } copyFileSync(archive, join(directory, 'react-native-executorch.tgz')); manifest.dependencies['react-native-executorch'] = 'file:./react-native-executorch.tgz'; @@ -227,4 +242,5 @@ if (profile.family === 'expo') { ['--no-install', 'expo', 'prebuild', '--platform', platform, '--no-install'], directory ); + if (profile.integrations) verifyIntegrationFixture(directory, platform); } diff --git a/.github/consumer-builds/validate-aab.mjs b/.github/consumer-builds/validate-aab.mjs new file mode 100644 index 0000000000..90b6419095 --- /dev/null +++ b/.github/consumer-builds/validate-aab.mjs @@ -0,0 +1,79 @@ +import assert from 'node:assert/strict'; +import { createHash } from 'node:crypto'; +import { spawnSync } from 'node:child_process'; +import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'; +import { join, resolve } from 'node:path'; +import { pathToFileURL } from 'node:url'; + +const version = '1.18.3'; +const checksum = 'a099cfa1543f55593bc2ed16a70a7c67fe54b1747bb7301f37fdfd6d91028e29'; + +export function verifyBundleEntries(listing) { + const entries = new Set(listing.trim().split(/\r?\n/)); + for (const file of [ + 'BundleConfig.pb', + 'base/manifest/AndroidManifest.xml', + 'base/dex/classes.dex', + 'base/assets/index.android.bundle', + ...[ + 'RnExecutorch', + 'executorch', + 'xnnpack_executorch_backend', + 'vulkan_executorch_backend', + ].map((library) => `base/lib/arm64-v8a/lib${library}.so`), + ]) + assert.ok(entries.has(file), `AAB is missing ${file}`); +} + +function run(command, args, capture = false) { + const result = spawnSync(command, args, { + encoding: 'utf8', + stdio: capture ? 'pipe' : 'inherit', + timeout: 120000, + maxBuffer: 8 * 1024 * 1024, + }); + if (result.error) throw result.error; + if (result.status !== 0) + throw new Error(`${command} failed: ${result.stderr ?? result.signal ?? result.status}`); + return result.stdout; +} + +async function main() { + const [bundle, cache, logs] = process.argv.slice(2); + if (!bundle || !cache || !logs) + throw new Error('Usage: validate-aab.mjs '); + mkdirSync(cache, { recursive: true }); + mkdirSync(logs, { recursive: true }); + const tool = join(cache, `bundletool-all-${version}.jar`); + if (!existsSync(tool)) { + const response = await fetch( + `https://github.com/google/bundletool/releases/download/${version}/bundletool-all-${version}.jar`, + { signal: AbortSignal.timeout(120000) } + ); + if (!response.ok) throw new Error(`bundletool download failed: ${response.status}`); + const bytes = Buffer.from(await response.arrayBuffer()); + assert.equal( + createHash('sha256').update(bytes).digest('hex'), + checksum, + 'bundletool checksum mismatch' + ); + writeFileSync(tool, bytes); + } + assert.equal( + createHash('sha256').update(readFileSync(tool)).digest('hex'), + checksum, + 'Cached bundletool checksum mismatch' + ); + run('java', ['-jar', tool, 'validate', `--bundle=${resolve(bundle)}`]); + const listing = run('jar', ['tf', resolve(bundle)], true); + writeFileSync(join(logs, 'aab-files.log'), listing); + verifyBundleEntries(listing); + console.log('PASS: bundletool validation, bundled JS and arm64 native libraries'); +} + +if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) { + main().catch((error) => { + console.error(error); + process.exitCode = 1; + }); +} diff --git a/.github/consumer-builds/validate-aab.test.mjs b/.github/consumer-builds/validate-aab.test.mjs new file mode 100644 index 0000000000..32389e3119 --- /dev/null +++ b/.github/consumer-builds/validate-aab.test.mjs @@ -0,0 +1,27 @@ +import assert from 'node:assert/strict'; +import { test } from 'node:test'; +import { verifyBundleEntries } from './validate-aab.mjs'; + +const entries = [ + 'BundleConfig.pb', + 'base/manifest/AndroidManifest.xml', + 'base/dex/classes.dex', + 'base/assets/index.android.bundle', + ...['RnExecutorch', 'executorch', 'xnnpack_executorch_backend', 'vulkan_executorch_backend'].map( + (library) => `base/lib/arm64-v8a/lib${library}.so` + ), +]; + +test('bundle packaging rejects missing JS, dex or native libraries, including libraries in the wrong ABI', () => { + verifyBundleEntries(entries.join('\r\n')); + for (const missing of entries) { + assert.throws( + () => verifyBundleEntries(entries.filter((file) => file !== missing).join('\n')), + /AAB is missing/ + ); + } + assert.throws( + () => verifyBundleEntries(entries.join('\n').replaceAll('/arm64-v8a/', '/x86_64/')), + /AAB is missing/ + ); +}); diff --git a/.github/workflows/consumer-builds.yml b/.github/workflows/consumer-builds.yml index 977896039c..a822579732 100644 --- a/.github/workflows/consumer-builds.yml +++ b/.github/workflows/consumer-builds.yml @@ -100,6 +100,7 @@ jobs: env: CI: '1' EXPO_NO_TELEMETRY: '1' + SENTRY_DISABLE_AUTO_UPLOAD: 'true' CONSUMER_ABI: ${{ matrix.smoke && matrix.platform == 'android' && 'x86_64' || 'arm64-v8a' }} steps: - name: Set consumer paths @@ -186,6 +187,18 @@ jobs: grep -F "lib/${CONSUMER_ABI}/lib${library}.so" "$LOG_DIR/apk-files.log" done cp "$apk" "$LOG_DIR/ConsumerBuild.apk" + - name: Build Android App Bundle + if: matrix.aab + working-directory: ${{ env.CONSUMER_DIR }}/android + run: | + ./gradlew :app:bundleRelease --no-daemon --stacktrace --max-workers=2 \ + 2>&1 | tee "$LOG_DIR/android-bundle.log" + cp app/build/outputs/bundle/release/app-release.aab "$LOG_DIR/ConsumerBuild.aab" + - name: Validate Android App Bundle and packaged native libraries + if: matrix.aab + run: | + node .github/consumer-builds/validate-aab.mjs "$LOG_DIR/ConsumerBuild.aab" \ + "$RUNNER_TEMP/bundletool" "$LOG_DIR" 2>&1 | tee "$LOG_DIR/aab-validation.log" - name: Build Android release on Windows with R8 if: runner.os == 'Windows' shell: pwsh @@ -261,7 +274,7 @@ jobs: if: always() run: | mkdir -p "$LOG_DIR" - for file in smoke-config.json consumer-profile.json package.json package-lock.json android/gradle.properties android/build.gradle android/app/build.gradle ios/Podfile ios/Podfile.lock ios/Podfile.properties.json; do + for file in smoke-config.json consumer-profile.json app.json metro.config.js package.json package-lock.json android/gradle.properties android/build.gradle android/app/build.gradle android/app/src/main/AndroidManifest.xml ios/Podfile ios/Podfile.lock ios/Podfile.properties.json ios/ConsumerBuild/Info.plist; do if [[ -f "$CONSUMER_DIR/$file" ]]; then destination="$LOG_DIR/config/$file" mkdir -p "$(dirname "$destination")" diff --git a/apps/consumer-fixtures/App.integration.jsx b/apps/consumer-fixtures/App.integration.jsx new file mode 100644 index 0000000000..eea6b58da1 --- /dev/null +++ b/apps/consumer-fixtures/App.integration.jsx @@ -0,0 +1,21 @@ +import React from 'react'; +import { SafeAreaView, Text } from 'react-native'; +import * as Sentry from '@sentry/react-native'; +import { getApp } from '@react-native-firebase/app'; +import { Camera } from 'react-native-vision-camera'; +import { AudioContext } from 'react-native-audio-api'; +import { tensor } from 'react-native-executorch'; + +// Referencing each import keeps its JS in the Release bundle. Native modules +// must also autolink and link successfully. This app is build-only. +export default function App() { + return ( + + + {[tensor, Sentry.init, getApp, Camera, AudioContext] + .map((value) => typeof value) + .join(', ')} + + + ); +}