Skip to content

ci: [SDK-4687] add Unity SDK E2E workflow#870

Merged
fadi-george merged 4 commits into
mainfrom
fadi/sdk-4687
May 18, 2026
Merged

ci: [SDK-4687] add Unity SDK E2E workflow#870
fadi-george merged 4 commits into
mainfrom
fadi/sdk-4687

Conversation

@fadi-george
Copy link
Copy Markdown
Collaborator

Description

One Line Summary

Add a GitHub Actions e2e workflow that builds the Unity demo app on each rel/** push (or manual dispatch) and runs the shared Appium suite against BrowserStack via OneSignal/sdk-shared.

Details

Motivation

Capacitor, DotNet, and Flutter SDKs already produce demo APK/IPAs in CI and exercise them against the shared Appium reusable workflow (Capacitor, DotNet). Unity already supports the E2E hooks (E2E_MODE, AccessibilityBridge, appium-unity-android/ios external IDs), but the workflow itself and a real-device iOS build entrypoint were missing. This PR closes that gap.

Scope

  • .github/workflows/e2e.yml: new workflow with build-android (ubuntu, game-ci/unity-builder, Maven-wait for the native Android SDK) and build-ios (macos, game-ci/unity-builder + xcodebuild archive/export using examples/demo/iOS/ExportOptions.plist), then e2e-android / e2e-ios jobs that reuse OneSignal/sdk-shared/.github/workflows/appium-e2e.yml@main with sdk-type: unity.
  • examples/demo/Assets/Scripts/Editor/BuildScript.cs: add BuildiOSDevice() so CI can produce a device IPA. The existing BuildiOSSimulator() emits a simulator binary that BrowserStack cannot install.
  • .github/actions/create-demo-env/action.yml: small composite action that writes the demo .env (ONESIGNAL_APP_ID, ONESIGNAL_API_KEY, E2E_MODE=true), matching the Flutter pattern.

Trigger surface matches other SDKs: push: rel/** and manual workflow_dispatch with a platform choice (android / ios / both).

Activation

Uses Unity Pro serial activation via game-ci, sourcing UNITY_SERIAL + UNITY_USERNAME + UNITY_PASSWORD repo secrets (named seat assigned to team-sdk-platform@onesignal.com).

Testing

Manual testing

  • Local validation already works via sdk-shared/appium/scripts/run-local.sh --sdk=unity --platform=android|ios, which uses the same BuildScript.BuildAndroidEmulator entrypoint as CI.
  • Smoke-test path on this PR: dispatch e2e.yml with platform=android from this branch, confirm Unity activation succeeds and demo-apk artifact uploads, then dispatch with platform=both to validate iOS signing/IPA export and the full BrowserStack run.

Unit testing

Not applicable. CI workflow / build script entrypoint only; no runtime SDK behavior change.

Affected code checklist

  • Notifications
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes
  • None (CI / demo app build scripts only)

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs (n/a)

Testing

  • I have included test coverage for these changes, or explained why they are not needed (workflow itself is the test; verified once dispatched)
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible (will dispatch once UNITY_SERIAL secret is set)

Final pass

  • Code is as readable as possible
  • I have reviewed this PR myself, ensuring it meets each checklist item

Made with Cursor

Comment thread .github/actions/create-demo-env/action.yml
Comment thread .github/workflows/e2e.yml
fadi-george and others added 2 commits May 18, 2026 13:31
- create-demo-env: route inputs through step env to avoid the documented
  Actions script-injection pattern. Same behavior; values arrive as
  environment variables instead of being textually substituted into the
  shell program.
- e2e.yml: rebase the iOS DerivedData cache key on inputs that exist at
  checkout time (manifest.json, ProjectVersion.txt, ProjectSettings.asset,
  com.onesignal.unity.{ios,core}/Editor/**, ExportOptions.plist) instead
  of the Unity-exported pbxproj/Podfile, which don't exist when the cache
  step runs and caused the key to collapse to a single global slot.

Co-authored-by: Cursor <cursoragent@cursor.com>
Matches the Capacitor demo .env pattern (channel `7ec2ece9-...`). Required
for the Appium "send WITH SOUND notification" spec on Android, which posts
a notification using this channel ID; without it the channel falls back
to default and the sound assertion fails. Exposed as an action input so a
future caller can override.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread .github/workflows/e2e.yml Outdated
Comment on lines +138 to +145
- name: Pod install
working-directory: examples/demo/Build/iOS
run: |
if [ -f Podfile ]; then
pod install --repo-update
else
echo "No Podfile in Unity-exported Xcode project; skipping pod install"
fi
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When wouldn't there be podfile present in this case? Should this fail instead?

Copy link
Copy Markdown
Collaborator Author

@fadi-george fadi-george May 18, 2026

Choose a reason for hiding this comment

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

Addressed

fadi-george added a commit that referenced this pull request May 18, 2026
EDM4U + com.onesignal.unity.ios/Editor/OneSignaliOSDependencies.xml always
generate a Podfile during iOS export because OneSignalXCFramework is
consumed via CocoaPods. The previous fallback that silently skipped pod
install on a missing Podfile would mask EDM4U / post-processor failures
and ship an IPA without OneSignal native deps. Surface it as an
::error:: instead. Addresses Sherwin's review comment on #870.

Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the Podfile presence check; `pod install` already errors out with
"[!] No \`Podfile' found in the project directory." when it's missing,
which is enough to fail the step and surface a broken EDM4U /
post-processor run. Addresses Sherwin's review comment on #870.

Co-authored-by: Cursor <cursoragent@cursor.com>
@fadi-george fadi-george merged commit 928341d into main May 18, 2026
4 checks passed
@fadi-george fadi-george deleted the fadi/sdk-4687 branch May 18, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants