Skip to content

Commit 8fc6b46

Browse files
authored
Simplify action steps
1 parent 9a318e3 commit 8fc6b46

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

.github/workflows/ios.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,17 @@ jobs:
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v2
17-
- name: Set Default Scheme
18-
run: |
19-
scheme_list=$(xcodebuild -list -json | tr -d "\n")
20-
default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]")
21-
echo $default | cat >default
22-
echo Using default scheme: $default
2317
- name: Build
2418
env:
25-
scheme: ${{ 'default' }}
2619
platform: ${{ 'iOS Simulator' }}
2720
run: |
2821
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
2922
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}'`
30-
if [ $scheme = default ]; then scheme=$(cat default); fi
31-
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
32-
file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
33-
xcodebuild build-for-testing -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device"
23+
xcodebuild build-for-testing -scheme "swift-bson" -destination "platform=$platform,name=$device"
3424
- name: Test
3525
env:
36-
scheme: ${{ 'default' }}
3726
platform: ${{ 'iOS Simulator' }}
3827
run: |
3928
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
4029
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}'`
41-
if [ $scheme = default ]; then scheme=$(cat default); fi
42-
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
43-
file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
44-
xcodebuild test-without-building -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device"
30+
xcodebuild test-without-building -scheme "swift-bson" -destination "platform=$platform,name=$device"

0 commit comments

Comments
 (0)