version: 2
jobs:
  iOStest:
    macos:
      xcode: "9.1.0"
    steps:
      - checkout
      - run: bundle install
      - run:
          name: Install Carthage Dependencies
          command: carthage update --platform iOS --no-use-binaries
      - run:
          name: Run Tests
          command: |
              xcodebuild -destination 'platform=iOS Simulator,name=iPhone 8,OS=latest' -sdk iphonesimulator -scheme "Fetch-iOS" clean test |
              tee xcodebuild.log |
              xcpretty --report html --output test_output/results.html --report junit --output test_output/results.xml
      - run:
          name: Post Coverage
          command: bundle exec slather
      - store_test_results:
          path: test_output/results.xml
      - store_artifacts:
          path: test_output/results.html
      - store_artifacts:
          path: xcodebuild.log
  tvOStest:
    macos:
      xcode: "9.1.0"
    steps:
      - checkout
      - run: bundle install
      - run:
          name: Install Carthage Dependencies
          command: carthage update --platform tvOS --no-use-binaries
      - run:
          name: Run Tests
          command: |
              xcodebuild -destination 'platform=tvOS Simulator,name=Apple TV 4K,OS=latest' -sdk appletvsimulator -scheme "Fetch-tvOS" clean test |
              tee xcodebuild.log

workflows:
  version: 2
  run-tests:
    jobs:
      - iOStest
      - tvOStest


version: 2
jobs:
  iOStest:
    macos:
      xcode: "9.3.0"
    steps:
      - checkout
      - run: bundle install
      - run:
          name: Install Carthage Dependencies
          command: carthage update --platform iOS --no-use-binaries
      - run:
          name: Run Tests
          command: |
              xcodebuild -destination 'platform=iOS Simulator,name=iPhone 8,OS=latest' -sdk iphonesimulator -scheme "Fetch-iOS" clean test |
              tee xcodebuild.log |
              xcpretty --report html --output test_output/results.html --report junit --output test_output/results.xml
      - run:
          name: Post Coverage
          command: bundle exec slather
      - store_test_results:
          path: test_output/results.xml
      - store_artifacts:
          path: test_output/results.html
      - store_artifacts:
          path: xcodebuild.log
  tvOStest:
    macos:
      xcode: "9.1.0"
    steps:
      - checkout
      - run: bundle install
      - run:
          name: Install Carthage Dependencies
          command: carthage update --platform tvOS --no-use-binaries
      - run:
          name: Run Tests
          command: |
              xcodebuild -destination 'platform=tvOS Simulator,name=Apple TV 4K,OS=latest' -sdk appletvsimulator -scheme "Fetch-tvOS" clean test |
              tee xcodebuild.log

workflows:
  version: 2
  run-tests:
    jobs:
      - iOStest
      - tvOStest


Use latest xcode on circle
Use latest xcode on circle
