Repository navigation
115 lines (100 loc) · 4.29 KB
/
Copy pathtest-harness-ios.yml
File metadata and controls
115 lines (100 loc) · 4.29 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
110
111
112
113
114
115
name: Build and test iOS
on:
workflow_call:
inputs:
full:
type: boolean
default: false
permissions:
contents: read
jobs:
test:
name: iOS integration tests, ${{ matrix.config.name }}, Xcode ${{ matrix.config.xcode }}
runs-on: macos-26
timeout-minutes: 40
strategy:
matrix:
config: ${{ fromJSON(inputs.full && '[{"name":"static_frameworks","frameworks":"static","xcode":"26.5"},{"name":"no_frameworks","frameworks":"","xcode":"26.5"},{"name":"static_frameworks","frameworks":"static","xcode":"26.2"}]' || '[{"name":"static_frameworks","frameworks":"static","xcode":"26.5"},{"name":"no_frameworks","frameworks":"","xcode":"26.5"}]') }}
env:
USE_CCACHE: 1
USE_FRAMEWORKS: ${{ matrix.config.frameworks }}
IOS_SIMULATOR_NAME: iPhone 17 Pro
IOS_SIMULATOR_OS: ${{ matrix.config.xcode }}
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v8
with:
name: ci-lockfiles
path: .
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.1
- name: Install npm dependencies (bun)
run: bun install --frozen-lockfile
- name: Install Ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
max-size: 500M
key: ${{ runner.os }}-${{ matrix.config.name }}-ccache-example-ios-xcode${{ matrix.config.xcode }}
create-symlink: true
- name: Setup ccache behavior
run: |
echo "CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros" >> $GITHUB_ENV
echo "CCACHE_FILECLONE=true" >> $GITHUB_ENV
echo "CCACHE_DEPEND=true" >> $GITHUB_ENV
echo "CCACHE_INODECACHE=true" >> $GITHUB_ENV
- name: Setup Ruby (bundle)
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.0
bundler-cache: true
working-directory: example
- name: Select Xcode ${{ matrix.config.xcode }}
run: sudo xcode-select -s "/Applications/Xcode_${{ matrix.config.xcode }}.app/Contents/Developer"
- name: Start iOS simulator
run: |
set -euo pipefail
simulator="$(xcrun simctl list devices available --json | node -e '
const { readFileSync } = require("node:fs")
const runtime = `com.apple.CoreSimulator.SimRuntime.iOS-${process.env.IOS_SIMULATOR_OS.replaceAll(".", "-")}`
const devices = JSON.parse(readFileSync(0, "utf8")).devices[runtime] ?? []
const device = devices.find((candidate) => candidate.name === process.env.IOS_SIMULATOR_NAME && candidate.isAvailable)
if (!device) throw new Error(`Simulator ${process.env.IOS_SIMULATOR_NAME} on ${runtime} is unavailable`)
console.log(`${device.udid} ${device.state}`)
')"
read -r simulator_udid simulator_state <<< "$simulator"
echo "IOS_SIMULATOR_UDID=$simulator_udid" >> "$GITHUB_ENV"
if [[ "$simulator_state" == "Shutdown" ]]; then
xcrun simctl boot "$simulator_udid"
fi
- name: Install Pods
working-directory: example
run: bun pods
- name: Build App
working-directory: example/ios
run: |
set -o pipefail
xcodebuild \
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
-derivedDataPath build/DerivedData -UseModernBuildSystem=YES \
-workspace NitroSQLiteExample.xcworkspace \
-scheme NitroSQLiteExample \
-sdk iphonesimulator \
-configuration Debug \
-destination 'generic/platform=iOS Simulator' \
-showBuildTimingSummary \
ONLY_ACTIVE_ARCH=YES \
build \
CODE_SIGNING_ALLOWED=NO | xcbeautify --renderer github-actions
- name: Wait for iOS simulator
timeout-minutes: 10
run: xcrun simctl bootstatus "$IOS_SIMULATOR_UDID" -b
- name: Run iOS integration tests
uses: callstackincubator/react-native-harness@v1.6.0
env:
HARNESS_DEBUG: "1"
with:
app: ios/build/DerivedData/Build/Products/Debug-iphonesimulator/NitroSQLiteExample.app
runner: ios
projectRoot: example
packageManager: bun