env:
  - DOCKER_SPARK_NLP_SCALA="${DOCKER_USERNAME}/spark-nlp-scala-${TRAVIS_BUILD_ID}" JAVA_OPTS="-XX:+UseG1GC"

sudo: required

services:
  - docker

cache:
  directories:
    - $HOME/.spark_nlp.dep.cache

jobs:
  include:
    - stage: build
      install: skip
      script: 
        - docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
        - docker build -t "$DOCKER_SPARK_NLP_SCALA" -f .ci/Dockerfile .
        - docker push "$DOCKER_SPARK_NLP_SCALA"
    - stage: scala
      install: skip
      language: scala
      script: docker run "$DOCKER_SPARK_NLP_SCALA" sbt -mem 4500 test
    - stage: python
      install: skip
      language: python
      python: "2.7"
      script:
        - docker build --build-arg from="$DOCKER_SPARK_NLP_SCALA" -t spark-nlp-python-2 -f .ci/DockerfilePy2 .
        - docker run spark-nlp-python-2 python2 run-tests.py
    - language: python
      python: "3.7"
      script:
       - docker build --build-arg from="$DOCKER_SPARK_NLP_SCALA" -t spark-nlp-python-3 -f .ci/DockerfilePy3 .
       - docker run spark-nlp-python-3 python3 run-tests.py

env:
  - DOCKER_SPARK_NLP_SCALA="${DOCKER_USERNAME}/spark-nlp-scala-${TRAVIS_BUILD_ID}" JAVA_OPTS="-XX:+UseG1GC"

sudo: required

services:
  - docker

cache:
  directories:
    - $HOME/.spark_nlp.dep.cache

jobs:
  include:
    - stage: build
      install: skip
      script: 
        - docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
        - docker build -t "$DOCKER_SPARK_NLP_SCALA" -f .ci/Dockerfile .
        - docker push "$DOCKER_SPARK_NLP_SCALA"
    - stage: scala
      install: skip
      language: scala
      script: docker run "$DOCKER_SPARK_NLP_SCALA" sbt -mem 8192 test
    - stage: python
      install: skip
      language: python
      python: "2.7"
      script:
        - docker build --build-arg from="$DOCKER_SPARK_NLP_SCALA" -t spark-nlp-python-2 -f .ci/DockerfilePy2 .
        - docker run spark-nlp-python-2 python2 run-tests.py
    - language: python
      python: "3.7"
      script:
       - docker build --build-arg from="$DOCKER_SPARK_NLP_SCALA" -t spark-nlp-python-3 -f .ci/DockerfilePy3 .
       - docker run spark-nlp-python-3 python3 run-tests.py

Increase Docker memory for test
Increase Docker memory for test
