|
| 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