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