Files
hapi/.github/workflows/ios.yml
T
weishu e1093466c9 feat(ios): support macOS through Mac Catalyst
Build the app and notification extension for Mac Catalyst with the Mac
idiom, so Macs get a 1:1 native window instead of the scaled iPad app.
The Mac build keeps the run.hapi.app bundle ID and adds Mac entitlements
(sandbox, network, microphone, user-selected files, Mac APNs).

- Always use the split on Mac with a sidebar list style, denser rows,
  14pt reading text, a hidden duplicate titlebar title, a minimum window
  size and page-sized sheets; open web links in the default browser and
  hide the unavailable live QR scanner.
- Add menu bar / hardware-keyboard commands: New Session, Settings,
  Toggle Sidebar, a Session menu (settings, files, rename, export, stop,
  previous/next session) and a guide link.
- Composer: Return sends on Mac (Shift/Option-Return for a newline, IME
  untouched, first suggestion picked); dropped files and pasted images or
  copied files become attachments on all platforms.
- CI builds Mac Catalyst and runs the navigation, split and transcript
  geometry tests there; README documents the Mac build.
2026-11-03 11:15:11 +08:00

73 lines
3.1 KiB
YAML

name: ios
on:
push:
branches:
- main
paths:
- 'ios/**'
- 'shared/fixtures/**'
- '.github/workflows/ios.yml'
pull_request:
paths:
- 'ios/**'
- 'shared/fixtures/**'
- '.github/workflows/ios.yml'
concurrency:
group: ios-${{ github.ref }}
cancel-in-progress: true
jobs:
# Xcode 27.1+ is required: the app uses iOS 27.1 SDK APIs (e.g. UIHingeInteraction).
package-tests:
runs-on: xcode-27
steps:
- uses: actions/checkout@v4
- name: Show toolchain versions
run: |
xcodebuild -version
swift --version
- name: Run HapiKit package tests
run: swift test --package-path ios/Packages/HapiKit
app-build:
runs-on: xcode-27
steps:
- uses: actions/checkout@v4
- name: Show toolchain versions
run: xcodebuild -version
- name: Check manual localization catalog
env:
PYTHONDONTWRITEBYTECODE: '1'
run: |
python3 ios/scripts/localizations.py --check
python3 -m unittest discover -s ios/scripts/tests -p 'test_localizations.py'
- name: Build Hapi app for iOS Simulator
run: xcodebuild build -project ios/Hapi.xcodeproj -scheme Hapi -destination 'generic/platform=iOS Simulator' CODE_SIGNING_ALLOWED=NO
- name: Transcript layout regression tests
run: ios/scripts/test-transcript.sh
- name: iPad navigation and layout regression tests
env:
HAPI_TEST_DEVICE_TYPE: com.apple.CoreSimulator.SimDeviceType.iPad-Air-11-inch-M2
run: >-
ios/scripts/test-transcript.sh
-only-testing:HapiTests/SessionNavigationTests
-only-testing:HapiTests/SessionSplitPresentationTests
-only-testing:HapiTests/TranscriptTypographyTests
-only-testing:HapiTests/TranscriptGeometryTests
- name: Build Hapi app for Mac Catalyst
run: xcodebuild build -project ios/Hapi.xcodeproj -scheme Hapi -destination 'platform=macOS,variant=Mac Catalyst' CODE_SIGNING_ALLOWED=NO
# Dynamic Type overrides do not scale Mac-idiom windows, so the
# typography suite stays on the iOS simulators above.
- name: Mac navigation and layout regression tests
run: >-
xcodebuild test -project ios/Hapi.xcodeproj -scheme Hapi
-destination 'platform=macOS,variant=Mac Catalyst'
-enableCodeCoverage NO -parallel-testing-enabled NO CODE_SIGNING_ALLOWED=NO
-only-testing:HapiTests/SessionNavigationTests
-only-testing:HapiTests/SessionSplitPresentationTests
-only-testing:HapiTests/TranscriptGeometryTests
- name: Verify localization catalog was not rewritten
run: git diff --exit-code -- ios/Hapi/Resources/Localizable.xcstrings