Skip to content

Commit 1ba7ac4

Browse files
authored
[CI] Add support for macOS / Xcode 26 in test.sh (#1761)
1 parent 0da362d commit 1ba7ac4

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

.github/workflows/firebaseai.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: firebaseai
22

3+
permissions:
4+
contents: read
5+
36
on:
47
pull_request:
58
paths:
@@ -19,20 +22,24 @@ env:
1922

2023
jobs:
2124
spm:
22-
name: spm (Xcode ${{ matrix.xcode }} - ${{ matrix.os }})
23-
runs-on: macOS-15
25+
name: spm (Xcode ${{ matrix.xcode }} - ${{ matrix.platform }})
2426
strategy:
2527
matrix:
26-
xcode: ["16.4"]
27-
os: [iOS]
2828
include:
29-
- os: iOS
29+
- os: macos-15
30+
xcode: "16.4"
31+
platform: iOS
3032
device: iPhone 16
33+
- os: macos-26
34+
xcode: "26.0"
35+
platform: iOS
36+
device: iPhone 16e
37+
runs-on: ${{ matrix.os }}
3138
env:
3239
SETUP: firebaseai
3340
SPM: true
3441
DIR: firebaseai
35-
OS: ${{ matrix.os }}
42+
OS: ${{ matrix.platform }}
3643
DEVICE: ${{ matrix.device }}
3744
TEST: false
3845
XCODE_VERSION: ${{ matrix.xcode }}
@@ -45,5 +52,5 @@ jobs:
4552
gem install xcpretty
4653
- name: Placeholder GoogleService-Info.plist good enough for build only testing.
4754
run: cp ./mock-GoogleService-Info.plist ./firebaseai/GoogleService-Info.plist
48-
- name: Build and Test SwiftUI (${{ matrix.os }})
55+
- name: Build and Test SwiftUI (${{ matrix.platform }})
4956
run: ./scripts/test.sh

scripts/test.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,19 @@
2020

2121
set -euo pipefail
2222

23-
if [ -d "/Applications/Xcode_16.4.app" ]; then
24-
xcode_version="16.4"
25-
iphone_version="16"
23+
xcode_version=$(xcodebuild -version | grep Xcode)
24+
xcode_version="${xcode_version/Xcode /}"
25+
xcode_major="${xcode_version/.*/}"
26+
27+
if [[ "$xcode_major" -ge 26 ]]; then
28+
iphone_version="17"
29+
elif [[ "$xcode_major" -ge 16 ]]; then
30+
iphone_version="16"
31+
elif [[ "$xcode_major" -ge 15 ]]; then
32+
iphone_version="15"
2633
else
27-
xcode_version="15.3"
28-
iphone_version="15"
34+
echo "Unsupported Xcode version $xcode_version; exiting." 1>&2
35+
exit 1
2936
fi
3037

3138
# Set default parameters

0 commit comments

Comments
 (0)