Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
danuja01 committed May 16, 2024
1 parent 3a246c5 commit 36e98c7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/objective-c-xcode.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Xcode - Build and Analyze
name: iOS starter workflow

on:
push:
Expand All @@ -8,7 +8,7 @@ on:

jobs:
build:
name: Build and analyse default scheme using xcodebuild command
name: Build and Test default scheme using any available iPhone simulator
runs-on: macos-latest

steps:
Expand All @@ -23,8 +23,11 @@ jobs:
- name: Build
env:
scheme: ${{ 'default' }}
platform: ${{ 'iOS Simulator' }}
run: |
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"`
if [ $scheme = default ]; then scheme=$(cat default); fi
if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi
file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
xcodebuild clean build analyze -scheme "$scheme" -"$filetype_parameter" "$file_to_build" | xcpretty && exit ${PIPESTATUS[0]}
xcodebuild build-for-testing -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device"

0 comments on commit 36e98c7

Please sign in to comment.