Added Snapshot Tests #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Xcode Build and Test | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
branches: | |
- main | |
- develop | |
workflow_dispatch: | |
jobs: | |
test: | |
name: Run Xcode Tests on iPhone 16 (iOS 18.1) | |
# macOS-latest should ideally include Xcode 16+, but we'll ensure it. | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# --- Crucial Step: Select Xcode 16.x --- | |
# This is the most likely fix for 'No such module SwiftUICore' | |
# and to get iOS 18.x simulators. | |
# As of current time (July 2025), macos-latest is expected to have Xcode 16.x. | |
# We'll explicitly select it to be sure. | |
- name: Select Xcode 16.x for iOS 18.1 support | |
# This action is reliable for selecting specific Xcode versions. | |
# Check maxim-lobanov/setup-xcode for available versions like '16.0', '16.1', etc. | |
# You can use 'latest-stable' for the newest Xcode available if you don't need a specific patch. | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: 'latest-stable' # Try 'latest-stable' first | |
# If 'latest-stable' still gives Xcode 15.x, | |
# explicitly try '16.0' or '16.1' (if you know it exists and is needed for your project). | |
# xcode-version: '16.1' | |
- name: Display active Xcode version after selection | |
run: xcodebuild -version | |
# Verify here that Xcode 16.x (or newer) is now active. | |
- name: List available iOS Simulators and their OS versions | |
# Now, this should show iPhone 16 with iOS 18.x if Xcode 16 is active. | |
run: xcrun simctl list devices | |
- name: Clean Xcode Derived Data | |
# Always good practice for CI to ensure a fresh build. | |
run: xcodebuild clean -scheme BuilderIO -destination "platform=iOS Simulator,name=iPhone 16,OS=18.1" | |
- name: Build and Test Xcode Project on iPhone 16 (iOS 18.1) | |
run: | | |
SIMULATOR_NAME="iPhone 16" | |
# Ensure this OS version is available with your selected Xcode 16.x | |
OS_VERSION="18.1" | |
DESTINATION="platform=iOS Simulator,name=${SIMULATOR_NAME},OS=${OS_VERSION}" | |
echo "Attempting to build and test on destination: $DESTINATION" | |
xcodebuild test -scheme BuilderIO \ | |
-destination "$DESTINATION" \ | |
CODE_SIGNING_ALLOWED=NO \ | |
CODE_SIGNING_REQUIRED=NO | |
# If you want to capture test results: | |
# -resultBundlePath "output/TestResults.xcresult" | |
# --- Optional: Upload Test Results --- | |
# - name: Upload Test Results (e.g., .xcresult bundle) | |
# if: always() | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: TestResults-BuilderIO | |
# path: output/TestResults.xcresult | |
# retention-days: 7 |