name: iOS
on: [push, pull_request]
jobs:
  iOS:
      name: Test on iOS
      runs-on: macOS-latest
      timeout-minutes: 15
      steps:
        - uses: actions/checkout@v2.3.2
        - uses: actions/cache@v2.1.1
          id: load-cache
          with:
            path: Example/Pods
            key: macos-pods-${{ hashFiles('**/Podfile.lock') }}
        - name: Install Cocoapods dependencies
          if: steps.load-cache.outputs.cache-hit != 'true'
          run: pod install --project-directory=Example
        - name: All Tests
          uses: sersoft-gmbh/xcodebuild-action@v1.1
          with:
            workspace: Example/PerspectiveTransform.xcworkspace
            scheme: Example
            destination: platform=iOS Simulator,name=iPhone 11 Pro
        - name: Report coverage
          run: bash <(curl -s 'https://codecov.io/bash') -Z -J '^PerspectiveTransform$' -X gcov -X fix
