Skip to content

Commit 054f272

Browse files
authored
Merge pull request #135 from Comcast/adding-github-actions-2.x
Adding action to build and test iOS and tvOS targets (Targeting version 2.x)
2 parents cd65779 + a4b4a04 commit 054f272

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Build and test
2+
3+
on:
4+
pull_request:
5+
branches: [ "develop", "develop_1.x", "main", "main_1.x" ]
6+
7+
jobs:
8+
define-ios-device:
9+
name: Get iOS simulator device to run iOS tests on
10+
runs-on: macos-latest
11+
outputs:
12+
device: ${{ steps.ios.outputs.device }}
13+
steps:
14+
- id: ios
15+
run: echo "device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"`" >> "$GITHUB_OUTPUT"
16+
17+
build:
18+
name: Build and Test mamba and mambaTVOS
19+
runs-on: macos-latest
20+
needs: define-ios-device
21+
strategy:
22+
matrix:
23+
target:
24+
- scheme: mamba
25+
platform: iOS Simulator
26+
device: ${{ needs.define-ios-device.outputs.device }}
27+
- scheme: mambaTVOS
28+
platform: tvOS Simulator
29+
device: Apple TV
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
- name: Build
34+
env:
35+
scheme: ${{ matrix.target.scheme }}
36+
platform: ${{ matrix.target.platform }}
37+
device: ${{ matrix.target.device }}
38+
run: |
39+
echo "scheme = $scheme"
40+
echo "platform = $platform"
41+
echo "device = $device"
42+
xcodebuild build-for-testing -scheme "$scheme" -"workspace" "mamba.xcworkspace" -destination "platform=$platform,name=$device"
43+
- name: Test
44+
env:
45+
scheme: ${{ matrix.target.scheme }}
46+
platform: ${{ matrix.target.platform }}
47+
device: ${{ matrix.target.device }}
48+
run: |
49+
echo "scheme = $scheme"
50+
echo "platform = $platform"
51+
echo "device = $device"
52+
xcodebuild test-without-building -scheme "$scheme" -"workspace" "mamba.xcworkspace" -destination "platform=$platform,name=$device"

0 commit comments

Comments
 (0)