Repository navigation
109 lines (91 loc) · 3.51 KB
/
Copy pathios.yml
File metadata and controls
109 lines (91 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: iOS Build & Test
on:
workflow_call:
env:
DEVICE_MODEL: 'iPhone 17'
IOS_VERSION: '26.2'
USE_CCACHE: 1
jobs:
ios:
name: iOS Build & Test
runs-on: macos-26
timeout-minutes: 60
env:
DEVELOPER_DIR: /Applications/Xcode_26.2.app/Contents/Developer
steps:
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v4.2.2
- name: Setup Project
uses: ./.github/actions/setup-node-yarn
- name: Setup Xcode
run: sudo xcode-select -s /Applications/Xcode_26.2.app
- name: Setup Ruby
uses: ruby/setup-ruby@d697be2f83c6234b20877c3b5eac7a7f342f0d0c # v1.204.0
with:
ruby-version: '3.2'
bundler-cache: true
working-directory: example
# Build dependencies (only if app not cached)
- name: Cache CocoaPods
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.2.0
with:
path: |
example/ios/Pods
~/Library/Caches/CocoaPods
~/.cocoapods
key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile.lock', 'yarn.lock', 'package.json', 'example/package.json') }}
- name: Install CocoaPods
working-directory: example
run: yarn pod
# Setup simulator
- name: Launch iOS Simulator
run: |
# Install jq if not available
if ! command -v jq &> /dev/null; then
brew install jq
fi
# Ensure `gtimeout` is available (coreutils) for robust timeouts on macOS.
if ! command -v gtimeout &> /dev/null; then
brew install coreutils
fi
# Launch simulator with our custom script
bash .github/scripts/launch-ios-simulator.sh "${{ env.DEVICE_MODEL }}" "${{ env.IOS_VERSION }}"
# XCTest unit tests in ios/Tests, installed by the MendixNative test spec in the Podfile.
# They need no app or Metro, so run them before the app build to fail early.
# The app build shares this derived data, so the pods aren't compiled again.
- name: Run native unit tests
working-directory: example/ios
run: |
xcodebuild test \
-workspace MendixNativeExample.xcworkspace \
-scheme MendixNative-Unit-Tests \
-destination "platform=iOS Simulator,name=${{ env.DEVICE_MODEL }},OS=${{ env.IOS_VERSION }}" \
-derivedDataPath build \
-resultBundlePath build/unit-tests.xcresult
- name: Upload native unit test results
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ios-unit-test-results
path: example/ios/build/unit-tests.xcresult
# Build iOS app (only if not cached)
- name: Build iOS app for simulator
if: steps.cache-ios-app.outputs.cache-hit != 'true'
working-directory: example
run: yarn app:package:ios
# Install app on simulator
- name: Install app on simulator
working-directory: example
run: yarn app:install:ios
# Wait for app and bridge to be fully ready
- name: Wait for React Native bridge initialization
run: |
echo "Waiting for app and bridge to be fully initialized..."
sleep 10
echo "Ready to run tests"
# Run tests
- name: Run Harness E2E tests
working-directory: example
run: |
export NODE_OPTIONS="--max-old-space-size=6144"
yarn harness:ios