-
-
Notifications
You must be signed in to change notification settings - Fork 277
108 lines (93 loc) · 3.46 KB
/
ios-tests.yml
File metadata and controls
108 lines (93 loc) · 3.46 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
name: iOS Tests
on:
pull_request:
paths:
- "TableProMobile/**"
- "Packages/TableProCore/**"
- "Libs/**"
- ".github/workflows/ios-tests.yml"
push:
branches: [main]
paths:
- "TableProMobile/**"
- "Packages/TableProCore/**"
- "Libs/**"
- ".github/workflows/ios-tests.yml"
workflow_dispatch:
# Only one run per PR/branch at a time; new pushes cancel pending older ones.
concurrency:
group: ios-tests-${{ github.ref }}
cancel-in-progress: true
env:
XCODE_PROJECT: TableProMobile/TableProMobile.xcodeproj
XCODE_SCHEME: TableProMobile
TEST_DESTINATION: "platform=iOS Simulator,name=iPhone 17 Pro,OS=latest"
jobs:
test:
name: Run iOS Tests
runs-on: macos-26
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- name: Select Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '26.4.1'
- name: Install xcbeautify
run: brew list xcbeautify &>/dev/null || brew install xcbeautify
# macos-26 lazy-loads simulator runtimes; -downloadPlatform pulls the runtime
# matching Xcode's SDK and is a no-op when it is already present.
- name: Install iOS simulator runtime
run: sudo xcodebuild -downloadPlatform iOS
# Secrets.xcconfig is gitignored. Tests do not need analytics keys, so the
# checked-in example template is enough for the project to resolve.
- name: Stub Secrets.xcconfig
run: cp TableProMobile/Secrets.xcconfig.example TableProMobile/Secrets.xcconfig
- name: Cache static libraries
uses: actions/cache@v4
with:
path: Libs
# Include the FreeTDS stub header in the cache key so iOS xcframework refreshes
# whenever the C bridge surface (e.g. new symbol declarations) changes.
key: ${{ runner.os }}-libs-${{ hashFiles('Libs/checksums.sha256', 'Plugins/MSSQLDriverPlugin/CFreeTDS/include/sybdb.h') }}
- name: Download static libraries
env:
GH_TOKEN: ${{ github.token }}
run: scripts/download-libs.sh
- name: Resolve Swift package dependencies
run: |
xcodebuild -resolvePackageDependencies \
-project "$XCODE_PROJECT" \
-scheme "$XCODE_SCHEME" \
-skipPackagePluginValidation
- name: Run unit tests
run: |
set -o pipefail
xcodebuild test \
-project "$XCODE_PROJECT" \
-scheme "$XCODE_SCHEME" \
-destination "$TEST_DESTINATION" \
-only-testing:TableProMobileTests \
-skipPackagePluginValidation \
-resultBundlePath TestResults.xcresult \
CODE_SIGNING_ALLOWED=NO \
| xcbeautify --renderer github-actions
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: ios-test-results
path: TestResults.xcresult
retention-days: 7
# Diagnostics only on failure so happy-path runs stay quiet.
- name: Show simulator state on failure
if: failure()
run: |
echo "=== iOS runtimes ==="
xcrun simctl list runtimes | grep -E "iOS|tvOS" || true
echo "=== Eligible scheme destinations ==="
xcodebuild -showdestinations \
-project "$XCODE_PROJECT" \
-scheme "$XCODE_SCHEME" \
-skipPackagePluginValidation 2>&1 \
| grep -E "iOS Simulator.*iPhone" || true