language: node_js
node_js: '10'

os:
  - linux

branches:
  only:
    - 'master'
    - 'next'

script:
  - npm run build
  # The `--no-cache` flag disables Parcel's cache as it can cause errors with building
  # same entries targeting different destinations.
  - npm run docs -- --no-cache
  - npm run lint:scripts -- --no-cache
  - npm run test:build --no-cache
  - travis_wait npm run test:run

after_success:
  # Upload screenshots to Argos
  - '[[ ! -z $ARGOS_TOKEN ]] && argos upload test/screenshots/local -C $TRAVIS_COMMIT -B $TRAVIS_BRANCH -T $ARGOS_TOKEN || true'

deploy:
  - provider: script
    script: npx semantic-release
    on:
      branch: master

  - provider: pages
    github_token: $GITHUB_TOKEN
    keep_history: true
    local_dir: ./docs
    on:
      branch: master

language: node_js
node_js: '10'

os:
  - linux

branches:
  only:
    - 'master'
    - 'next'

script:
  - npm run build
  # The `--no-cache` flag disables Parcel's cache as it can cause errors with building
  # same entries targeting different destinations.
  - npm run docs -- --no-cache
  - npm run lint:scripts -- --no-cache
  - npm run test:build --no-cache
  - '[[! -z $SAUCE_ACCESS_KEY ]] && travis_wait npm run test:run'

after_success:
  # Upload screenshots to Argos
  - '[[ ! -z $ARGOS_TOKEN ]] && argos upload test/screenshots/local -C $TRAVIS_COMMIT -B $TRAVIS_BRANCH -T $ARGOS_TOKEN || true'

deploy:
  - provider: script
    script: npx semantic-release
    on:
      branch: master

  - provider: pages
    github_token: $GITHUB_TOKEN
    keep_history: true
    local_dir: ./docs
    on:
      branch: master

Make access key a condition for test
ci(SauceLabs): Make access key a condition for test
