Skip to content

Commit 0968217

Browse files
authored
Merge pull request #284 from IFTTT/feature/github_actions_workflow
Create ios.yml
2 parents 1bdc624 + d381850 commit 0968217

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/ios.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build and run tests
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
name: Build and Test SDKHostApp scheme using any available iPhone simulator
12+
runs-on: macos-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
- name: Build
18+
env:
19+
scheme: ${{ 'SDKHostApp' }}
20+
platform: ${{ 'iOS Simulator' }}
21+
run: |
22+
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
23+
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}'`
24+
if [ $scheme = default ]; then scheme=$(cat default); fi
25+
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
26+
file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
27+
xcodebuild build-for-testing -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device"
28+
- name: Test
29+
env:
30+
scheme: ${{ 'SDKHostApp' }}
31+
platform: ${{ 'iOS Simulator' }}
32+
run: |
33+
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
34+
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}'`
35+
if [ $scheme = default ]; then scheme=$(cat default); fi
36+
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
37+
file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
38+
xcodebuild test-without-building -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device"

0 commit comments

Comments
 (0)