<commit_before>sudo: false

addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - g++-4.9

matrix:
  include:
    - os: linux
      env: NODE_VERSION="4" CXX="g++-4.9"    # abi 46
    - os: linux
      env: NODE_VERSION="5" CXX="g++-4.9"    # abi 47
    - os: linux
      env: NODE_VERSION="6" CXX="g++-4.9"    # abi 48
    # os x x86
    - os: osx
      env: NODE_VERSION="4" CXX="clang"
    - os: osx
      env: NODE_VERSION="5" CXX="clang"
    - os: osx
      env: NODE_VERSION="6" CXX="clang"
    # osx ia32
    - os: osx
      env: NODE_VERSION="4" TARGET_ARCH="ia32" CXX="clang"
    - os: osx
      env: NODE_VERSION="5" TARGET_ARCH="ia32" CXX="clang"
    - os: osx
      env: NODE_VERSION="6" TARGET_ARCH="ia32" CXX="clang"

before_install:
  - rm -rf ~/.nvm/ && git clone --depth 1 "https://github.com/creationix/nvm.git" ~/.nvm
  - source ~/.nvm/nvm.sh
  - nvm install $NODE_VERSION
  - nvm use $NODE_VERSION
  - export PATH="./node_modules/.bin/:$PATH"

install:
  - npm install

script:
  - if [[ -z "$TARGET_ARCH" ]]; then
      node-pre-gyp rebuild package testpackage --build-from-source;
      npm test;
    else
      node-pre-gyp rebuild package testpackage --build-from-source --target_arch=$TARGET_ARCH;
    fi

git:
  depth: 10

branches:
  only:
    - master
    - /^v\d+\.\d+\.\d+(?:-[a-z0-9.-]+)?$/

before_deploy:
  - export RELEASE_NODE_FILE=$(find build/stage -name '*.tar.gz')
  - echo "Deploying $RELEASE_NODE_FILE to GitHub"

deploy:
  provider: releases
  api_key:
    secure: <KEY>
  file: "$RELEASE_NODE_FILE"
  skip_cleanup: true
  on:
    repo: hansonw/fuzzy-native
    tags: true<commit_msg>Remove ABI 46 (Node 4) and add Electron prebuilts<commit_after>sudo: false

addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - g++-4.9

matrix:
  include:
    # linux
    - os: linux   # abi 47
      env: NODE_VERSION="5.1.1" TARGET_ARCH="x64"
    - os: linux   # abi 48
      env: NODE_VERSION="6" TARGET_ARCH="x64"
    - os: linux   # abi 49
      env: NODE_VERSION="6" ELECTRON="1.3.6" TARGET_ARCH="x64"
    # os x x86
    - os: osx
      env: NODE_VERSION="5.1.1" TARGET_ARCH="x64" CXX="clang"
    - os: osx
      env: NODE_VERSION="6" TARGET_ARCH="x64" CXX="clang"
    - os: osx
      env: NODE_VERSION="6" ELECTRON="1.3.6" TARGET_ARCH="x64" CXX="clang"
    # osx ia32
    - os: osx
      env: NODE_VERSION="5.1.1" TARGET_ARCH="ia32" CXX="clang"
    - os: osx
      env: NODE_VERSION="6" TARGET_ARCH="ia32" CXX="clang"
    - os: osx
      env: NODE_VERSION="6" ELECTRON="1.3.6" TARGET_ARCH="ia32" CXX="clang"

before_install:
  - rm -rf ~/.nvm/ && git clone --depth 1 "https://github.com/creationix/nvm.git" ~/.nvm
  - source ~/.nvm/nvm.sh
  - nvm install $NODE_VERSION
  - nvm use $NODE_VERSION
  - export PATH="./node_modules/.bin/:$PATH"

install:
  - npm install

script:
  - if [[ -z "$ELECTRON" ]]; then
      node-pre-gyp rebuild package testpackage \
        --build-from-source --target_arch=$TARGET_ARCH;
    else
      node-pre-gyp rebuild package testpackage \
        --runtime=electron --target=$ELECTRON \
        --dist-url=https://atom.io/download/atom-shell \
        --build-from-source --target_arch=$TARGET_ARCH;
    fi
  - if [[ "$TARGET_ARCH" == "x64" && -z "$ELECTRON" ]]; then
      npm test;
    fi

git:
  depth: 10

branches:
  only:
    - master
    - /^v\d+\.\d+\.\d+(?:-[a-z0-9.-]+)?$/

before_deploy:
  - export RELEASE_NODE_FILE=$(find build/stage -name '*.tar.gz')
  - echo "Deploying $RELEASE_NODE_FILE to GitHub"

deploy:
  provider: releases
  api_key:
    secure: <KEY>
  file: "$RELEASE_NODE_FILE"
  skip_cleanup: true
  on:
    repo: hansonw/fuzzy-native
    tags: true
{'fraction_non_alphanumeric': 0.16274668829413355, 'fraction_numerical': 0.027575020275750203, 'mean_word_length': 2.461178671655753, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4837264', 'n_tokens_mistral': 1575, 'n_tokens_neox': 1486, 'n_words': 315}