Update sample app for 2025 with SwiftUI and SwiftData #38
Workflow file for this run
This file contains 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: Run tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest-stable | |
- name: Determine test device | |
run: | | |
echo "PLATFORM=iOS Simulator" >> "$GITHUB_ENV" | |
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959) | |
echo "DEVICE=$(xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//")" >> "$GITHUB_ENV" | |
- name: UI Tests | |
run: | | |
set -o pipefail && xcodebuild -project SaladSampleApp.xcodeproj \ | |
-scheme SaladSampleApp \ | |
-testPlan UITests \ | |
-destination "platform=$PLATFORM,name=$DEVICE" \ | |
-resultBundlePath "./ResultBundle.xcresult" \ | |
test | xcpretty | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
if: ${{ failure() }} | |
with: | |
name: ResultBundle.xcresult | |
path: ./ResultBundle.xcresult |