language: node_js
node_js:
  - '10'
  - '12'

cache:
  directories:
    - '$HOME/.npm'

install:
  # todo: remove the `|| npm install` part below when we no run CI with node 6
  - npm ci || npm install

before_script:
  - travis_wait npm run bootstrap
  - npm run build
script:
  # Run tests in all packages
  - npx lerna run test --concurrency=2 --stream

  # Allow running the Sanity CLI tool without specifying absolute path
  - export PATH="${TRAVIS_BUILD_DIR}/packages/@sanity/cli/bin:$PATH"

  # Build CLI to a single file
  - cd packages/@sanity/cli
  - npm run pack

  # Remove source and dependencies from CLI to ensure it works standalone
  - rm -rf packages/@sanity/cli/node_modules
  - rm -rf packages/@sanity/cli/src && rm -rf packages/@sanity/cli/lib

  # Test building the test studio with all customizations
  - cd $TRAVIS_BUILD_DIR/packages/test-studio
  - sanity build

  # Test initializing a project in unattended mode
  - cd /tmp
  - sanity init -y --project=ppsg7ml5 --dataset=test --output-path=/tmp/test-project

  # Use the newly commited changes instead of the latest dependencies from NPM
  - cd /tmp/test-project
  - $TRAVIS_BUILD_DIR/scripts/symlinkDependencies.js .

  # Test building the project with latest dependencies
  - sanity build --skip-minify

language: node_js
node_js:
  - '10'
  - '12'

cache:
  directories:
    - '$HOME/.npm'

env:
  - NODE_OPTIONS=--max_old_space_size=8192

install:
  # todo: remove the `|| npm install` part below when we no run CI with node 6
  - npm ci || npm install

before_script:
  - travis_wait npm run bootstrap
  - npm run build
script:
  # Run tests in all packages
  - npx lerna run test --concurrency=2 --stream

  # Allow running the Sanity CLI tool without specifying absolute path
  - export PATH="${TRAVIS_BUILD_DIR}/packages/@sanity/cli/bin:$PATH"

  # Build CLI to a single file
  - cd packages/@sanity/cli
  - npm run pack

  # Remove source and dependencies from CLI to ensure it works standalone
  - rm -rf packages/@sanity/cli/node_modules
  - rm -rf packages/@sanity/cli/src && rm -rf packages/@sanity/cli/lib

  # Test building the test studio with all customizations
  - cd $TRAVIS_BUILD_DIR/packages/test-studio
  - sanity build

  # Test initializing a project in unattended mode
  - cd /tmp
  - sanity init -y --project=ppsg7ml5 --dataset=test --output-path=/tmp/test-project

  # Use the newly commited changes instead of the latest dependencies from NPM
  - cd /tmp/test-project
  - $TRAVIS_BUILD_DIR/scripts/symlinkDependencies.js .

  # Test building the project with latest dependencies
  - sanity build --skip-minify

Raise memory limit on CI
[chore] Raise memory limit on CI
