<commit_before>sudo: true  # Only to move mysql onto ramdisk.
os: linux
dist: xenial
language: go
go: "1.13.x"
go_import_path: github.com/google/trillian

addons:
  apt:
    packages:
      - softhsm

cache:
  directories:
    - "$HOME/.cache/go-build"
    - "$HOME/.cache/go-build-race"
    - "$HOME/google-cloud-sdk/"
    - "$HOME/gopath/pkg/mod"

env:
  global:
  - GO111MODULE=on
  - GOPROXY=https://proxy.golang.org
  matrix:
  - PRESUB_TESTS=true                                      PRESUBMIT_OPTS="--no-build"  # only lint & generate
  - PRESUB_TESTS=true                                      PRESUBMIT_OPTS="--coverage --no-linters --no-generate"
  - PRESUB_TESTS=true GOFLAGS='-race'                      PRESUBMIT_OPTS="--no-linters --no-generate"
  - PRESUB_TESTS=true GOFLAGS='-race --tags=batched_queue' PRESUBMIT_OPTS="--no-linters --no-generate"
  - PRESUB_TESTS=true GOFLAGS='-race' WITH_ETCD=true       PRESUBMIT_OPTS="--no-linters --no-generate"
  - PRESUB_TESTS=true GOFLAGS='-race --tags=pkcs11' WITH_PKCS11=true PRESUBMIT_OPTS="--no-linters --no-generate"
  - CT_INTEG_TEST=true                                     PRESUBMIT_OPTS="--no-linters --no-generate"
  - INTEG_TESTS=true                                       PRESUBMIT_OPTS="--coverage --no-linters --no-generate"
  - INTEG_TESTS=true GOFLAGS='-race'                       PRESUBMIT_OPTS="--no-linters --no-generate"
  - INTEG_TESTS=true GOFLAGS='-race --tags=batched_queue'  PRESUBMIT_OPTS="--no-linters --no-generate"
  - INTEG_TESTS=true GOFLAGS='-race' WITH_ETCD=true        PRESUBMIT_OPTS="--no-linters --no-generate"
  - INTEG_TESTS=true GOFLAGS='-race --tags=pkcs11' WITH_PKCS11=true PRESUBMIT_OPTS="--no-linters --no-generate"
  - BAZEL_TESTS=true                                       PRESUBMIT_OPTS="--no-linters --no-generate"
  - DOCKER_TESTS=true                                      PRESUBMIT_OPTS="--no-linters --no-generate"

matrix:
  fast_finish: true

services:
  - docker
  - postgresql
  - mysql

before_install:
  - sudo service mysql stop
  - |
    if [[ "$TRAVIS_SUDO" == "true" ]]; then
      echo "Moving MySQL data to ramdisk..."
      sudo mkdir /mnt/ramdisk
      sudo mount -t tmpfs -o size=1024m tmpfs /mnt/ramdisk
      sudo mv /var/lib/mysql /mnt/ramdisk
      sudo ln -s /mnt/ramdisk/mysql /var/lib/mysql
    else
     echo "MySQL data staying on disk because sudo unavailable."
    fi
  - sudo service mysql start

install:
  - |
    if [[ "${GOFLAGS}" == *-race* ]]; then
      export GOCACHE="$(go env GOCACHE)-race"
    fi
  - mkdir ../protoc
  - |
    (
      cd ../protoc
      wget "https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-${TRAVIS_OS_NAME}-x86_64.zip"
      unzip "protoc-3.5.1-${TRAVIS_OS_NAME}-x86_64.zip"
    )
  - export PATH="$(pwd)/../protoc/bin:$PATH"
  # googleapis is not Go code, but it's required for .pb.go regeneration because of API dependencies.
  - git clone --depth=1 https://github.com/googleapis/googleapis.git "$GOPATH/src/github.com/googleapis/googleapis"
  - |
    export TOOLS=""
    if [[ "${PRESUBMIT_OPTS}" != *no-generate* ]]; then
      TOOLS+=" github.com/golang/mock/mockgen"
      TOOLS+=" github.com/golang/protobuf/proto"
      TOOLS+=" github.com/golang/protobuf/protoc-gen-go"
      TOOLS+=" github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway"
      TOOLS+=" github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc"
      TOOLS+=" golang.org/x/tools/cmd/stringer"
    fi
    if [[ "${PRESUBMIT_OPTS}" != *no-build* ]]; then
      TOOLS+=" go.etcd.io/etcd"
      TOOLS+=" go.etcd.io/etcd/etcdctl"
    fi
    if [[ "${PRESUBMIT_OPTS}" != *no-linters* ]]; then
      TOOLS+=" github.com/golangci/golangci-lint/cmd/golangci-lint"
      TOOLS+=" github.com/uber/prototool/cmd/prototool"
    fi
    echo Installing ${TOOLS}...
    GOPROXY=direct go install ${TOOLS}
  # install bazel
  - |
    (<commit_msg>Use the proxy to fetch the tools. (#1829)<commit_after>sudo: true  # Only to move mysql onto ramdisk.
os: linux
dist: xenial
language: go
go: "1.13.x"
go_import_path: github.com/google/trillian

addons:
  apt:
    packages:
      - softhsm

cache:
  directories:
    - "$HOME/.cache/go-build"
    - "$HOME/.cache/go-build-race"
    - "$HOME/google-cloud-sdk/"
    - "$HOME/gopath/pkg/mod"

env:
  global:
  - GO111MODULE=on
  - GOPROXY=https://proxy.golang.org
  matrix:
  - PRESUB_TESTS=true                                      PRESUBMIT_OPTS="--no-build"  # only lint & generate
  - PRESUB_TESTS=true                                      PRESUBMIT_OPTS="--coverage --no-linters --no-generate"
  - PRESUB_TESTS=true GOFLAGS='-race'                      PRESUBMIT_OPTS="--no-linters --no-generate"
  - PRESUB_TESTS=true GOFLAGS='-race --tags=batched_queue' PRESUBMIT_OPTS="--no-linters --no-generate"
  - PRESUB_TESTS=true GOFLAGS='-race' WITH_ETCD=true       PRESUBMIT_OPTS="--no-linters --no-generate"
  - PRESUB_TESTS=true GOFLAGS='-race --tags=pkcs11' WITH_PKCS11=true PRESUBMIT_OPTS="--no-linters --no-generate"
  - CT_INTEG_TEST=true                                     PRESUBMIT_OPTS="--no-linters --no-generate"
  - INTEG_TESTS=true                                       PRESUBMIT_OPTS="--coverage --no-linters --no-generate"
  - INTEG_TESTS=true GOFLAGS='-race'                       PRESUBMIT_OPTS="--no-linters --no-generate"
  - INTEG_TESTS=true GOFLAGS='-race --tags=batched_queue'  PRESUBMIT_OPTS="--no-linters --no-generate"
  - INTEG_TESTS=true GOFLAGS='-race' WITH_ETCD=true        PRESUBMIT_OPTS="--no-linters --no-generate"
  - INTEG_TESTS=true GOFLAGS='-race --tags=pkcs11' WITH_PKCS11=true PRESUBMIT_OPTS="--no-linters --no-generate"
  - BAZEL_TESTS=true                                       PRESUBMIT_OPTS="--no-linters --no-generate"
  - DOCKER_TESTS=true                                      PRESUBMIT_OPTS="--no-linters --no-generate"

matrix:
  fast_finish: true

services:
  - docker
  - postgresql
  - mysql

before_install:
  - sudo service mysql stop
  - |
    if [[ "$TRAVIS_SUDO" == "true" ]]; then
      echo "Moving MySQL data to ramdisk..."
      sudo mkdir /mnt/ramdisk
      sudo mount -t tmpfs -o size=1024m tmpfs /mnt/ramdisk
      sudo mv /var/lib/mysql /mnt/ramdisk
      sudo ln -s /mnt/ramdisk/mysql /var/lib/mysql
    else
     echo "MySQL data staying on disk because sudo unavailable."
    fi
  - sudo service mysql start

install:
  - |
    if [[ "${GOFLAGS}" == *-race* ]]; then
      export GOCACHE="$(go env GOCACHE)-race"
    fi
  - mkdir ../protoc
  - |
    (
      cd ../protoc
      wget "https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-${TRAVIS_OS_NAME}-x86_64.zip"
      unzip "protoc-3.5.1-${TRAVIS_OS_NAME}-x86_64.zip"
    )
  - export PATH="$(pwd)/../protoc/bin:$PATH"
  # googleapis is not Go code, but it's required for .pb.go regeneration because of API dependencies.
  - git clone --depth=1 https://github.com/googleapis/googleapis.git "$GOPATH/src/github.com/googleapis/googleapis"
  - |
    export TOOLS=""
    if [[ "${PRESUBMIT_OPTS}" != *no-generate* ]]; then
      TOOLS+=" github.com/golang/mock/mockgen"
      TOOLS+=" github.com/golang/protobuf/proto"
      TOOLS+=" github.com/golang/protobuf/protoc-gen-go"
      TOOLS+=" github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway"
      TOOLS+=" github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc"
      TOOLS+=" golang.org/x/tools/cmd/stringer"
    fi
    if [[ "${PRESUBMIT_OPTS}" != *no-build* ]]; then
      TOOLS+=" go.etcd.io/etcd"
      TOOLS+=" go.etcd.io/etcd/etcdctl"
    fi
    if [[ "${PRESUBMIT_OPTS}" != *no-linters* ]]; then
      TOOLS+=" github.com/golangci/golangci-lint/cmd/golangci-lint"
      TOOLS+=" github.com/uber/prototool/cmd/prototool"
    fi
    echo Installing ${TOOLS}...
    go install ${TOOLS}
  # install bazel
  - |
    (
{'fraction_non_alphanumeric': 0.15177087328986064, 'fraction_numerical': 0.009717427438946427, 'mean_word_length': 2.331345826235094, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5340083', 'n_tokens_mistral': 3119, 'n_tokens_neox': 2891, 'n_words': 482}