<commit_before>sudo: false

env:
  global:
  - NODE_VERSION="9.11.2"
  - ANDROID_API=27
  - ANDROID_BUILD_TOOLS=27.0.3

notifications:
  email: false

branches:
  only:
  - master

matrix:
  include:
  - os: linux
    env: CORDOVA_VERSION="8.0.0" CORDOVA_PLATFORM="browser"
    language: node_js
    node_js: '${NODE_VERSION}'
  - env: CORDOVA_VERSION="8.0.0" CORDOVA_PLATFORM="android-7.0"
    os: linux
    node_js: '${NODE_VERSION}'
    language: android
    jdk: oraclejdk8
    android:
      components:
        - tools
        - android-$EMULATOR_API
        - platform-tools
        - tools
        # The BuildTools version used by your project
        - build-tools-${ANDROID_BUILD_TOOLS}
        # The SDK version used to compile your project
        - android-${ANDROID_API}
        # Additional components
        - extra-android-m2repository
        - extra-google-m2repository
        - sys-img-armeabi-v7a-android-${ANDROID_API}
      licenses:
        - ".+"

install:
  - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm
    && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm
    install ${NODE_VERSION} > /dev/null
  - node --version
  - npm install -g cordova@${CORDOVA_VERSION} > /dev/null
  - cordova --version
  - if [[ "$PLATFORM" =~ android ]]; then
      yes | sdkmanager "platforms;android-${ANDROID_API}"; > /dev/null;
    fi
  - npm install

before_script:
  - git clone https://github.com/apache/cordova-paramedic
  - pushd cordova-paramedic
  - npm i > /dev/null
  - popd
  - cordova --version
  - if [[ "$PLATFORM" =~ android ]]; then
      echo "y" | android update sdk -a --no-ui --filter android-${ANDROID_API} > /dev/null;
      echo "y" | android update sdk -a --no-ui --filter sys-img-armeabi-v7a-android-${ANDROID_API} > /dev/null;
      echo no | android create avd --force -n test -t android-${ANDROID_API} --abi armeabi-v7a > /dev/null;
      emulator -avd test -no-skin -no-window;
      android-wait-for-emulator ;
      adb shell input keyevent 82;
      adb wait-for-device get-serialno;
    fi

script:
  - npm test
  - if [[ "$PLATFORM" =~ android ]]; then<commit_msg>test again<commit_after>sudo: false

env:
  global:
  - NODE_VERSION="9.11.2"
  - ANDROID_API=27
  - ANDROID_BUILD_TOOLS=27.0.3

notifications:
  email: false

branches:
  only:
  - master

matrix:
  include:
  - os: linux
    env: CORDOVA_VERSION="8.0.0" CORDOVA_PLATFORM="browser"
    language: node_js
    node_js: '${NODE_VERSION}'
  - env: CORDOVA_VERSION="8.0.0" CORDOVA_PLATFORM="android-7.0"
    os: linux
    node_js: '${NODE_VERSION}'
    language: android
    jdk: oraclejdk8
    android:
      components:
        - tools
        - android-$EMULATOR_API
        - platform-tools
        - tools
        # The BuildTools version used by your project
        - build-tools-${ANDROID_BUILD_TOOLS}
        # The SDK version used to compile your project
        - android-${ANDROID_API}
        # Additional components
        - extra-android-m2repository
        - extra-google-m2repository
        - sys-img-armeabi-v7a-android-${ANDROID_API}
      licenses:
        - ".+"

install:
  - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm
    && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm
    install ${NODE_VERSION} > /dev/null
  - node --version
  - npm install -g cordova@${CORDOVA_VERSION} > /dev/null
  - cordova --version
  - if [[ "$PLATFORM" =~ android ]]; then
      touch $HOME/.android/avd > /dev/null 2>&1;
      yes | sdkmanager "platforms;android-${ANDROID_API}"; > /dev/null;
    fi
  - npm install

before_script:
  - git clone https://github.com/apache/cordova-paramedic
  - pushd cordova-paramedic
  - npm i > /dev/null
  - popd
  - cordova --version
  - if [[ "$PLATFORM" =~ android ]]; then
      echo "y" | android update sdk -a --no-ui --filter android-${ANDROID_API} > /dev/null;
      echo "y" | android update sdk -a --no-ui --filter sys-img-armeabi-v7a-android-${ANDROID_API} > /dev/null;
      echo no | android create avd --force -n test -t android-${ANDROID_API} --abi armeabi-v7a > /dev/null;
      emulator -avd test -no-skin -no-window;
      android-wait-for-emulator ;
      adb shell input keyevent 82;
      adb wait-for-device get-serialno;
    fi

script:
  - npm test
  - if [[ "$PLATFORM" =~ android ]]; then
{'fraction_non_alphanumeric': 0.1424682395644283, 'fraction_numerical': 0.012704174228675136, 'mean_word_length': 2.370795107033639, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7164719', 'n_tokens_mistral': 1648, 'n_tokens_neox': 1598, 'n_words': 358}