diff --git a/.github/workflows/firebaseai.yml b/.github/workflows/firebaseai.yml index eb3357cdb..65378ba39 100644 --- a/.github/workflows/firebaseai.yml +++ b/.github/workflows/firebaseai.yml @@ -1,5 +1,8 @@ name: firebaseai +permissions: + contents: read + on: pull_request: paths: @@ -19,20 +22,24 @@ env: jobs: spm: - name: spm (Xcode ${{ matrix.xcode }} - ${{ matrix.os }}) - runs-on: macOS-15 + name: spm (Xcode ${{ matrix.xcode }} - ${{ matrix.platform }}) strategy: matrix: - xcode: ["16.4"] - os: [iOS] include: - - os: iOS + - os: macos-15 + xcode: "16.4" + platform: iOS device: iPhone 16 + - os: macos-26 + xcode: "26.0" + platform: iOS + device: iPhone 16e + runs-on: ${{ matrix.os }} env: SETUP: firebaseai SPM: true DIR: firebaseai - OS: ${{ matrix.os }} + OS: ${{ matrix.platform }} DEVICE: ${{ matrix.device }} TEST: false XCODE_VERSION: ${{ matrix.xcode }} @@ -45,5 +52,5 @@ jobs: gem install xcpretty - name: Placeholder GoogleService-Info.plist good enough for build only testing. run: cp ./mock-GoogleService-Info.plist ./firebaseai/GoogleService-Info.plist - - name: Build and Test SwiftUI (${{ matrix.os }}) + - name: Build and Test SwiftUI (${{ matrix.platform }}) run: ./scripts/test.sh diff --git a/scripts/test.sh b/scripts/test.sh index bbc78fb45..283035efa 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -20,12 +20,19 @@ set -euo pipefail -if [ -d "/Applications/Xcode_16.4.app" ]; then - xcode_version="16.4" - iphone_version="16" +xcode_version=$(xcodebuild -version | grep Xcode) +xcode_version="${xcode_version/Xcode /}" +xcode_major="${xcode_version/.*/}" + +if [[ "$xcode_major" -ge 26 ]]; then + iphone_version="17" +elif [[ "$xcode_major" -ge 16 ]]; then + iphone_version="16" +elif [[ "$xcode_major" -ge 15 ]]; then + iphone_version="15" else - xcode_version="15.3" - iphone_version="15" + echo "Unsupported Xcode version $xcode_version; exiting." 1>&2 + exit 1 fi # Set default parameters