osx_image: xcode10.1
language: swift

branches:
  only:
    - master

stages:
  - name: test
  - name: beta
    if: (type == push) AND (branch == master) AND (commit_message =~ /^\[beta\]/)

cache:
  bundler: true
  cocoapods: true
  directories:
    - subtrees/the-blue-alliance-react/node_modules

install:
  - cd subtrees/the-blue-alliance-react && npm install && cd ../..
  - bundle install
  - bundle exec pod check || bundle exec pod install || bundle exec pod install --repo-update

before_script:
  - cp mock-Secrets.plist the-blue-alliance-ios/Secrets.plist
  - bundle exec fastlane setup_ci
  - echo -e "machine github.com\n  login $GITHUB_TOKEN" > ~/.netrc

jobs:
  include:
    - stage: test
      name: "Unit Tests"
      script:
        - bundle exec fastlane test_unit
    - stage: beta
      script:
        - bundle exec fastlane setup_secrets
        - bundle exec fastlane beta_ci

after_failure:
  - cat build/reports/tba-unit-tests-tba-unit-tests.log | bundle exec second_curtain > /dev/null
  - ls logs

osx_image: xcode10.1
language: swift

branches:
  only:
    - master

stages:
  - name: test
    if: NOT ((type == push) AND (commit_message =~ /^\[clowntown\]/))
  - name: beta
    if: (type == push) AND (branch == master) AND (commit_message =~ /^\[beta\]/)

cache:
  bundler: true
  cocoapods: true
  directories:
    - subtrees/the-blue-alliance-react/node_modules

install:
  - brew install watchman
  - cd subtrees/the-blue-alliance-react && npm install && cd ../..
  - bundle install
  - bundle exec pod check || bundle exec pod install || bundle exec pod install --repo-update

before_script:
  - cp mock-Secrets.plist the-blue-alliance-ios/Secrets.plist
  - bundle exec fastlane setup_ci
  - echo -e "machine github.com\n  login $GITHUB_TOKEN" > ~/.netrc

jobs:
  include:
    - stage: test
      name: "Unit Tests"
      script:
        - bundle exec fastlane test_unit
    - stage: beta
      script:
        - bundle exec fastlane setup_secrets
        - bundle exec fastlane beta_ci

after_failure:
  - cat build/reports/tba-unit-tests-tba-unit-tests.log | bundle exec second_curtain > /dev/null

Install Watchman so we can build
[clowntown] Install Watchman so we can build

[beta]
