cobrowse-sdk-react-native 3.8.0 → 3.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/actions/install-npm-deps/action.yml +26 -0
- package/.github/actions/install-packaged-sdk/action.yml +22 -0
- package/.github/actions/install-pods/action.yml +20 -0
- package/.github/dependabot.yml +27 -0
- package/.github/workflows/build-android.yml +37 -0
- package/.github/workflows/build-ios.yml +51 -0
- package/.github/workflows/build.yml +67 -0
- package/.github/workflows/e2e-android.yml +95 -0
- package/.github/workflows/e2e-ios.yml +58 -0
- package/.github/workflows/release.yml +1 -1
- package/.github/workflows/test.yml +40 -0
- package/CHANGELOG.md +374 -0
- package/android/build.gradle +1 -1
- package/cobrowse-sdk-react-native.podspec +1 -1
- package/js/CBIOBroadcastPickerView.tsx +1 -1
- package/js/CobrowseView.tsx +6 -6
- package/js/Redacted.tsx +1 -1
- package/js/Session.ts +8 -3
- package/lib/commonjs/CBIOBroadcastPickerView.js +4 -1
- package/lib/commonjs/CBIOBroadcastPickerView.js.map +1 -1
- package/lib/commonjs/CobrowseAccessibilityService.js.map +1 -1
- package/lib/commonjs/CobrowseIO.js.map +1 -1
- package/lib/commonjs/CobrowseView.js +35 -22
- package/lib/commonjs/CobrowseView.js.map +1 -1
- package/lib/commonjs/Redacted.js +6 -4
- package/lib/commonjs/Redacted.js.map +1 -1
- package/lib/commonjs/Session.js +10 -5
- package/lib/commonjs/Session.js.map +1 -1
- package/lib/commonjs/SessionControl.js +1 -1
- package/lib/commonjs/SessionControl.js.map +1 -1
- package/lib/commonjs/Unredacted.js +6 -7
- package/lib/commonjs/Unredacted.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/useSession.js.map +1 -1
- package/lib/module/CBIOBroadcastPickerView.js +6 -1
- package/lib/module/CBIOBroadcastPickerView.js.map +1 -1
- package/lib/module/CobrowseAccessibilityService.js +2 -0
- package/lib/module/CobrowseAccessibilityService.js.map +1 -1
- package/lib/module/CobrowseIO.js +2 -0
- package/lib/module/CobrowseIO.js.map +1 -1
- package/lib/module/CobrowseView.js +37 -22
- package/lib/module/CobrowseView.js.map +1 -1
- package/lib/module/Redacted.js +8 -4
- package/lib/module/Redacted.js.map +1 -1
- package/lib/module/Session.js +12 -5
- package/lib/module/Session.js.map +1 -1
- package/lib/module/SessionControl.js +3 -1
- package/lib/module/SessionControl.js.map +1 -1
- package/lib/module/Unredacted.js +8 -7
- package/lib/module/Unredacted.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/useSession.js +2 -0
- package/lib/module/useSession.js.map +1 -1
- package/lib/typescript/CBIOBroadcastPickerView.d.ts +2 -2
- package/lib/typescript/CBIOBroadcastPickerView.d.ts.map +1 -1
- package/lib/typescript/CobrowseView.d.ts +6 -6
- package/lib/typescript/CobrowseView.d.ts.map +1 -1
- package/lib/typescript/Redacted.d.ts +2 -2
- package/lib/typescript/Redacted.d.ts.map +1 -1
- package/lib/typescript/Session.d.ts.map +1 -1
- package/package.json +28 -9
- package/tsconfig.build.json +4 -1
- package/tsconfig.json +4 -2
- package/.github/workflows/lint.yaml +0 -20
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: Install npm dependencies
|
|
2
|
+
description: >-
|
|
3
|
+
Install Node.js (with npm caching) and run `npm ci` for both the SDK (repo root —
|
|
4
|
+
needed by the symlinked SDK and `npm pack`) and the Example app, so the Example is
|
|
5
|
+
ready to build. Assumes the repo is already checked out.
|
|
6
|
+
|
|
7
|
+
runs:
|
|
8
|
+
using: composite
|
|
9
|
+
steps:
|
|
10
|
+
- name: Install Node.js
|
|
11
|
+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
12
|
+
with:
|
|
13
|
+
node-version-file: .nvmrc
|
|
14
|
+
cache: 'npm'
|
|
15
|
+
cache-dependency-path: |
|
|
16
|
+
package-lock.json
|
|
17
|
+
Example/package-lock.json
|
|
18
|
+
|
|
19
|
+
- name: Install SDK dependencies
|
|
20
|
+
shell: bash
|
|
21
|
+
run: npm ci
|
|
22
|
+
|
|
23
|
+
- name: Install Example dependencies
|
|
24
|
+
shell: bash
|
|
25
|
+
run: npm ci
|
|
26
|
+
working-directory: Example
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: Install the packaged SDK into the Example app
|
|
2
|
+
description: >-
|
|
3
|
+
Pack the SDK (`npm pack` → runs prepack = `bob build`, exactly what publish does)
|
|
4
|
+
and install the tarball over the Example app's `file:../` symlink, so the app
|
|
5
|
+
bundles/links against what actually ships rather than the working tree. `npm install`
|
|
6
|
+
is used rather than manually extracting the tarball so npm resolves the SDK's runtime
|
|
7
|
+
deps (e.g. lodash). Assumes Node and the Example app's deps are already installed.
|
|
8
|
+
|
|
9
|
+
runs:
|
|
10
|
+
using: composite
|
|
11
|
+
steps:
|
|
12
|
+
- name: Install the packaged SDK into the Example app
|
|
13
|
+
shell: bash
|
|
14
|
+
run: |
|
|
15
|
+
npm pack --pack-destination "$RUNNER_TEMP"
|
|
16
|
+
cd Example
|
|
17
|
+
npm install "$RUNNER_TEMP"/cobrowse-sdk-react-native-*.tgz --no-save
|
|
18
|
+
# The install must have replaced the file:../ symlink with the real package,
|
|
19
|
+
# otherwise we'd silently be testing the working tree again.
|
|
20
|
+
test -d node_modules/cobrowse-sdk-react-native && test ! -L node_modules/cobrowse-sdk-react-native \
|
|
21
|
+
|| { echo "::error::packaged SDK install did not take (dependency is still a symlink)"; exit 1; }
|
|
22
|
+
echo "Installed packaged SDK $(node -p "require('./node_modules/cobrowse-sdk-react-native/package.json').version")"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: Install CocoaPods dependencies
|
|
2
|
+
description: >-
|
|
3
|
+
Run `pod install` for the Example iOS app, retrying to survive the transient 503s that
|
|
4
|
+
hit Hermes' source download. Assumes the Example's node deps (and, for the e2e, the
|
|
5
|
+
packaged SDK) are already installed, since `pod install` resolves native modules from
|
|
6
|
+
node_modules.
|
|
7
|
+
|
|
8
|
+
runs:
|
|
9
|
+
using: composite
|
|
10
|
+
steps:
|
|
11
|
+
- name: Install Pods
|
|
12
|
+
shell: bash
|
|
13
|
+
working-directory: Example/ios
|
|
14
|
+
run: |
|
|
15
|
+
for attempt in 1 2 3; do
|
|
16
|
+
pod install && exit 0
|
|
17
|
+
echo "pod install failed (attempt $attempt) — retrying in 15s…"
|
|
18
|
+
sleep 15
|
|
19
|
+
done
|
|
20
|
+
exit 1
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
|
|
3
|
+
updates:
|
|
4
|
+
- package-ecosystem: "npm"
|
|
5
|
+
directories:
|
|
6
|
+
- "/"
|
|
7
|
+
- "/Example"
|
|
8
|
+
schedule:
|
|
9
|
+
interval: "weekly"
|
|
10
|
+
# Take security updates only: `0` disables version updates but
|
|
11
|
+
# security updates are not subject to the limit.
|
|
12
|
+
open-pull-requests-limit: 0
|
|
13
|
+
ignore:
|
|
14
|
+
# CI fixtures — they exist so jest and tsc have a React Native to
|
|
15
|
+
# resolve against. React and React Native must move together, so
|
|
16
|
+
# bumping them is a deliberate change rather than an automatic one.
|
|
17
|
+
- dependency-name: "react"
|
|
18
|
+
- dependency-name: "react-native"
|
|
19
|
+
- dependency-name: "react-test-renderer"
|
|
20
|
+
- dependency-name: "@types/react-test-renderer"
|
|
21
|
+
- dependency-name: "metro-react-native-babel-preset"
|
|
22
|
+
- dependency-name: "@react-native/*"
|
|
23
|
+
|
|
24
|
+
# Shipped to consumers via optionalDependencies — bumping these is a
|
|
25
|
+
# customer-facing change that must move with the React upgrade.
|
|
26
|
+
- dependency-name: "@types/react"
|
|
27
|
+
- dependency-name: "@types/react-native"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Build Android
|
|
2
|
+
|
|
3
|
+
# Compiles and validates the SDK's native Android module by building the Example app.
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
# A newer push to the same PR cancels the in-flight run.
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
build-android:
|
|
18
|
+
name: Build Example app (Android)
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
timeout-minutes: 25
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
23
|
+
|
|
24
|
+
- name: Install npm dependencies
|
|
25
|
+
uses: ./.github/actions/install-npm-deps
|
|
26
|
+
|
|
27
|
+
# AGP 8.2.2 / Gradle 8.2.1 require JDK 17 (they reject 21). Pin explicitly.
|
|
28
|
+
- uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
|
|
29
|
+
name: Install JDK 17
|
|
30
|
+
with:
|
|
31
|
+
distribution: 'temurin'
|
|
32
|
+
java-version: '17'
|
|
33
|
+
cache: 'gradle'
|
|
34
|
+
|
|
35
|
+
- name: Build debug APK
|
|
36
|
+
run: ./gradlew :app:assembleDebug
|
|
37
|
+
working-directory: Example/android
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: Build iOS
|
|
2
|
+
|
|
3
|
+
# Compiles and validates the SDK's native iOS module by building the Example app.
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
# A newer push to the same PR cancels the in-flight run.
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
build-ios:
|
|
18
|
+
name: Build Example app (iOS)
|
|
19
|
+
runs-on: macos-14
|
|
20
|
+
timeout-minutes: 45
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
23
|
+
|
|
24
|
+
- name: Install npm dependencies
|
|
25
|
+
uses: ./.github/actions/install-npm-deps
|
|
26
|
+
|
|
27
|
+
- name: Install Pods
|
|
28
|
+
uses: ./.github/actions/install-pods
|
|
29
|
+
|
|
30
|
+
# Simulator build so no signing needed. Also compiles the Full-Device-Screen-Sharing extension.
|
|
31
|
+
- name: Build Example app
|
|
32
|
+
working-directory: Example/ios
|
|
33
|
+
run: |
|
|
34
|
+
xcodebuild \
|
|
35
|
+
-workspace Example.xcworkspace \
|
|
36
|
+
-scheme Example \
|
|
37
|
+
-configuration Debug \
|
|
38
|
+
-destination 'generic/platform=iOS Simulator' \
|
|
39
|
+
-resultBundlePath build/Example.xcresult \
|
|
40
|
+
CODE_SIGNING_ALLOWED=NO \
|
|
41
|
+
build
|
|
42
|
+
|
|
43
|
+
# xcodebuild output is huge/truncated in the UI; the .xcresult has the structured errors.
|
|
44
|
+
- name: Upload xcodebuild result bundle (on failure)
|
|
45
|
+
if: failure()
|
|
46
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
47
|
+
with:
|
|
48
|
+
name: ios-xcresult
|
|
49
|
+
path: Example/ios/build/Example.xcresult
|
|
50
|
+
retention-days: 7
|
|
51
|
+
if-no-files-found: ignore
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
name: Build
|
|
2
|
+
|
|
3
|
+
# Builds and validates the publishable npm package.
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
# A newer push to the same PR cancels the in-flight run.
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
build-package:
|
|
18
|
+
name: Build & validate npm package
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
timeout-minutes: 10
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
23
|
+
|
|
24
|
+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
25
|
+
name: Install Node.js
|
|
26
|
+
with:
|
|
27
|
+
node-version-file: .nvmrc
|
|
28
|
+
cache: 'npm'
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: npm ci
|
|
32
|
+
|
|
33
|
+
- name: Build package (react-native-builder-bob)
|
|
34
|
+
run: npm run build
|
|
35
|
+
|
|
36
|
+
# `npm pack` runs the `prepack` script (bob build), so a dry-run exercises
|
|
37
|
+
# the exact build path `npm publish` takes — a broken publish fails here.
|
|
38
|
+
- name: Validate publish/pack path
|
|
39
|
+
run: npm pack --dry-run
|
|
40
|
+
|
|
41
|
+
# --- Advisory checks (non-blocking for now) ---
|
|
42
|
+
# These surface real, pre-existing packaging issues (main/module both point
|
|
43
|
+
# at the ESM build; no `type` field; internal files shipped). They are
|
|
44
|
+
# `continue-on-error` until the packaging fixes land, then flip to required
|
|
45
|
+
# by removing `continue-on-error` (and add `--strict` to publint).
|
|
46
|
+
|
|
47
|
+
- name: Validate package exports (publint) [advisory]
|
|
48
|
+
continue-on-error: true
|
|
49
|
+
run: npx --yes publint@0.3.22
|
|
50
|
+
|
|
51
|
+
- name: Validate type resolution (are-the-types-wrong) [advisory]
|
|
52
|
+
continue-on-error: true
|
|
53
|
+
run: npx --yes @arethetypeswrong/cli@0.18.5 --pack .
|
|
54
|
+
|
|
55
|
+
# Repo sanity: no build/codegen step above should modify or create tracked
|
|
56
|
+
# files. lib/ is gitignored, so this is a no-op today — it's a tripwire for
|
|
57
|
+
# when generated artefacts or a codegen step (e.g. a bob upgrade) later
|
|
58
|
+
# become part of the repo. `git status --porcelain` also catches new
|
|
59
|
+
# untracked files, which `git diff --exit-code` would miss.
|
|
60
|
+
- name: Verify working tree is clean
|
|
61
|
+
run: |
|
|
62
|
+
if [ -n "$(git status --porcelain)" ]; then
|
|
63
|
+
echo "::error::Build steps modified tracked files — commit the changes or fix the build."
|
|
64
|
+
git status --porcelain
|
|
65
|
+
git diff
|
|
66
|
+
exit 1
|
|
67
|
+
fi
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
name: E2E Android
|
|
2
|
+
|
|
3
|
+
# Validates the native Android Example app builds, runs, and can call the Cobrowse SDK.
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
# A newer push to the same PR cancels the in-flight run.
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
e2e-android:
|
|
18
|
+
name: E2E Example app (Android)
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
timeout-minutes: 45
|
|
21
|
+
# Build the Example against the *packaged* SDK (installed below), not the
|
|
22
|
+
# working-tree symlink — so this validates what actually ships. Read by
|
|
23
|
+
# Example/metro.config.js to pick the packaged-vs-symlink resolver.
|
|
24
|
+
env:
|
|
25
|
+
E2E_PACKAGED: '1'
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
28
|
+
|
|
29
|
+
- name: Install npm dependencies
|
|
30
|
+
uses: ./.github/actions/install-npm-deps
|
|
31
|
+
|
|
32
|
+
# AGP 8.2.2 / Gradle 8.2.1 require JDK 17.
|
|
33
|
+
- uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
|
|
34
|
+
name: Install JDK 17
|
|
35
|
+
with:
|
|
36
|
+
distribution: 'temurin'
|
|
37
|
+
java-version: '17'
|
|
38
|
+
cache: 'gradle'
|
|
39
|
+
|
|
40
|
+
- name: Install the packaged SDK into the Example app
|
|
41
|
+
uses: ./.github/actions/install-packaged-sdk
|
|
42
|
+
|
|
43
|
+
# Release embeds the JS bundle and is debug-keystore signed, so both APKs install on the emulator.
|
|
44
|
+
- name: Build release + test APKs
|
|
45
|
+
run: ./gradlew :app:assembleRelease :app:assembleReleaseAndroidTest
|
|
46
|
+
working-directory: Example/android
|
|
47
|
+
|
|
48
|
+
# Reclaim space from large preinstalled toolchains we don't use. The emulator's
|
|
49
|
+
# userdata partition is ~7GB once the build outputs are on disk.
|
|
50
|
+
- name: Free up disk space
|
|
51
|
+
run: |
|
|
52
|
+
df -h /
|
|
53
|
+
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/.ghcup \
|
|
54
|
+
/usr/share/swift /opt/hostedtoolcache/CodeQL
|
|
55
|
+
df -h /
|
|
56
|
+
|
|
57
|
+
# Emulators need hardware acceleration (KVM) to boot in reasonable time.
|
|
58
|
+
- name: Enable KVM
|
|
59
|
+
run: |
|
|
60
|
+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
|
61
|
+
sudo udevadm control --reload-rules
|
|
62
|
+
sudo udevadm trigger --name-match=kvm
|
|
63
|
+
|
|
64
|
+
- name: Boot emulator and run E2E tests
|
|
65
|
+
uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a # v2.37.0
|
|
66
|
+
env:
|
|
67
|
+
# Wait longer for the emulator to shut down cleanly before the action force-kills
|
|
68
|
+
# it (default 20s) — avoids spurious teardown errors on slow/loaded runners.
|
|
69
|
+
ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL: 180
|
|
70
|
+
with:
|
|
71
|
+
api-level: 34
|
|
72
|
+
target: google_apis
|
|
73
|
+
arch: x86_64
|
|
74
|
+
force-avd-creation: false
|
|
75
|
+
working-directory: Example/android
|
|
76
|
+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
|
77
|
+
disable-animations: true
|
|
78
|
+
# Capture full logcat to a file (uploaded on failure) for red-run diagnostics,
|
|
79
|
+
# then install the app + test APKs, run E2ETests, and report pass/fail.
|
|
80
|
+
script: |
|
|
81
|
+
adb logcat -c
|
|
82
|
+
adb logcat > emulator.log &
|
|
83
|
+
./gradlew :app:connectedReleaseAndroidTest
|
|
84
|
+
|
|
85
|
+
# Test reports + full logcat for debugging red runs.
|
|
86
|
+
- name: Upload instrumented-test report (on failure)
|
|
87
|
+
if: failure()
|
|
88
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
89
|
+
with:
|
|
90
|
+
name: android-e2e-report
|
|
91
|
+
path: |
|
|
92
|
+
Example/android/app/build/reports/androidTests/connected
|
|
93
|
+
Example/android/emulator.log
|
|
94
|
+
retention-days: 7
|
|
95
|
+
if-no-files-found: ignore
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
name: E2E iOS
|
|
2
|
+
|
|
3
|
+
# Validates the native iOS Example app builds, runs, and can call the Cobrowse SDK.
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
# A newer push to the same PR cancels the in-flight run.
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
e2e-ios:
|
|
18
|
+
name: E2E Example app (iOS)
|
|
19
|
+
runs-on: macos-14
|
|
20
|
+
timeout-minutes: 60
|
|
21
|
+
# Build the Example against the *packaged* SDK (installed below), not the
|
|
22
|
+
# working-tree symlink — so this validates what actually ships. Read by
|
|
23
|
+
# Example/metro.config.js (JS bundle) and, via node_modules, by `pod install`.
|
|
24
|
+
env:
|
|
25
|
+
E2E_PACKAGED: '1'
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
28
|
+
|
|
29
|
+
- name: Install npm dependencies
|
|
30
|
+
uses: ./.github/actions/install-npm-deps
|
|
31
|
+
|
|
32
|
+
# pod install (next) resolves the packaged podspec + ios/ from node_modules.
|
|
33
|
+
- name: Install the packaged SDK into the Example app
|
|
34
|
+
uses: ./.github/actions/install-packaged-sdk
|
|
35
|
+
|
|
36
|
+
- name: Install Pods
|
|
37
|
+
uses: ./.github/actions/install-pods
|
|
38
|
+
|
|
39
|
+
# Release config embeds the JS bundle (no Metro); simulator build needs no signing.
|
|
40
|
+
- name: Run iOS E2E test
|
|
41
|
+
working-directory: Example/ios
|
|
42
|
+
run: |
|
|
43
|
+
xcodebuild test \
|
|
44
|
+
-workspace Example.xcworkspace \
|
|
45
|
+
-scheme Example \
|
|
46
|
+
-configuration Release \
|
|
47
|
+
-destination 'platform=iOS Simulator,name=iPhone 15,OS=latest' \
|
|
48
|
+
-resultBundlePath build/ExampleE2E.xcresult \
|
|
49
|
+
CODE_SIGNING_ALLOWED=NO
|
|
50
|
+
|
|
51
|
+
- name: Upload xcresult (on failure)
|
|
52
|
+
if: failure()
|
|
53
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
54
|
+
with:
|
|
55
|
+
name: ios-e2e-xcresult
|
|
56
|
+
path: Example/ios/build/ExampleE2E.xcresult
|
|
57
|
+
retention-days: 7
|
|
58
|
+
if-no-files-found: ignore
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
# Correctness checks for the JS layer: lint, type-check, and unit tests.
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
# A newer push to the same PR cancels the in-flight run.
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
test:
|
|
18
|
+
name: Lint, type-check & unit tests
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
timeout-minutes: 10
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
23
|
+
|
|
24
|
+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
25
|
+
name: Install Node.js
|
|
26
|
+
with:
|
|
27
|
+
node-version-file: .nvmrc
|
|
28
|
+
cache: 'npm'
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: npm ci
|
|
32
|
+
|
|
33
|
+
- name: Lint (ts-standard)
|
|
34
|
+
run: npm run lint
|
|
35
|
+
|
|
36
|
+
- name: Type-check (tsc --noEmit)
|
|
37
|
+
run: npm run typecheck
|
|
38
|
+
|
|
39
|
+
- name: Unit tests (jest)
|
|
40
|
+
run: npm test
|