name: Build (iOS/tvOS)

on: [push, pull_request]

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
  cancel-in-progress: true

jobs:
  Build:
    name: ${{ matrix.platform.name }}
    runs-on: macos-latest

    strategy:
      fail-fast: false
      matrix:
        platform:
        - { name: iOS, target: SDL3, sdk: iphoneos }
        - { name: tvOS, target: SDL3, sdk: appletvos }

    steps:
      - uses: actions/checkout@v4
      - name: Build
        run: xcodebuild -project Xcode/SDL/SDL.xcodeproj -target '${{ matrix.platform.target }}' -configuration Release -sdk ${{ matrix.platform.sdk }} clean build
