<commit_before>sudo: false
language: node_js
node_js: "8"

notifications:
  email: false

git:
  depth: 3
  submodules: false

env:
  global:
    - SAUCE_USERNAME_PR=valorkinpr
    - SAUCE_ACCESS_KEY_PR=<KEY>
    - BROWSER_PROVIDER_READY_FILE=/tmp/sauce-connect-ready
    - LOGS_DIR=/tmp/logs

stages:
  - name: precache
    if: ( branch = development AND type = push ) OR type = pull_request
  - name: lint
    if: ( branch = development AND type = push ) OR type = pull_request
  - name: test
    if: ( branch = development AND type = push ) OR type = pull_request
  - name: build
    if: ( branch = development AND type = push ) OR type = pull_request
  - name: deploy
    if: branch = development AND type = push
  - name: publish
    if: branch = development AND type = push AND tag =~ ^v2
  - name: sauce-tests
    if: ( branch = development AND type = push ) OR type = pull_request

before_install:
  - export CHROME_BIN=chromium-browser
  - export DISPLAY=:99.0
  - sh -e /etc/init.d/xvfb start
  - rm -rf node_modules/ngx-bootstrap

install:
  - npm install > /dev/null
  - npm run build > /dev/null
  - if [[ "$NGV" == "latest" ]]; then  ./scripts/ci/npm-ng-latest.sh; fi
  - if [[ "$NGV" == "next" ]]; then  ./scripts/ci/npm-ng-next.sh; fi
  - npm i ./dist  > /dev/null
  - if [[ "$TRAVIS_PULL_REQUEST" != false ]]; then export SAUCE_USERNAME=$SAUCE_USERNAME_PR; export SAUCE_ACCESS_KEY=$SAUCE_ACCESS_KEY_PR; fi

jobs:
  fast_finish: true
  allow_failures:
    - env: NGV=next
    - env: SAUCE=true
    - stage: sauce-tests
  include:
# precache npm and apt dependencies
    - stage: precache
      install: npm install > /dev/null
      script: true
      addons:
        chrome: stable
        apt:
          sources:
          - ubuntu-toolchain-r-test
          # required by node-gyp to build some packages
          packages:
          - g++-4.8
#   lint code
    - stage: lint
      install: true
      script: npm run lint
#   test
    - &test
      stage: test
      script: npm run test-coverage
      after_success:
        - ./node_modules/.bin/codecov
    - <<: *test
      env: NGV=latest
    - <<: *test
      env: NGV=next
#    check prod build
    - &build
      stage: build
      script: npm run demo.ng-build
    - <<: *build
      env: NGV=latest
    - <<: *build
      env: NGV=next
    - stage: sauce-tests
      env: SAUCE=true
      before_script:
        - mkdir -p $LOGS_DIR
        - ./scripts/sauce/sauce_connect_setup.sh
      script:
        - ./scripts/sauce/sauce_connect_block.sh
        - npm run test-cross
      after_script: ./scripts/sauce/sauce_connect_teardown.sh
#   deploy to ngx-bootstrap.surge.sh
    - &surge
      stage: deploy
      script: npm run demo.build
      deploy:
        provider: surge
        project: ./gh-pages/
        domain: ngx-bootstrap.surge.sh
        on: development
    - <<: *surge
      env: NGV=latest
      deploy:
        provider: surge
        project: ./gh-pages/
        domain: ngx-bootstrap-latest.surge.sh
        on: development
    - stage: deploy
      script: npm run build:dynamic
      deploy:
        provider: heroku
        api_key: $HEROKU_API_KEY
        skip_cleanup: true
        app: ngx-universal
        on: development
    - stage: publish
      script: npm run demo.build
      after_deploy: npm run flow.github-release
      deploy:
        provider: pages
        local_dir: gh-pages
        skip_cleanup: true
        github_token: $GITHUB_TOKEN
        app: ngx-universal
        on:
          tags: true
          branch: development
    - stage: publish
      script: npm run build
      before_deploy: "cd dist"
      deploy:
        provider: npm
        email: "<EMAIL>"
        api_key: $NPM_AUTH_TOKEN
        tag: next
        skip_cleanup: true
        on:
          tags: true
          branch: development

cache:
  apt: true
  npm: true
  directories:
    - node_modules
<commit_msg>chore(ci): run publish on tagged commits<commit_after>sudo: false
language: node_js
node_js: "8"

notifications:
  email: false

git:
  depth: 3
  submodules: false

env:
  global:
    - SAUCE_USERNAME_PR=valorkinpr
    - SAUCE_ACCESS_KEY_PR=<KEY>
    - BROWSER_PROVIDER_READY_FILE=/tmp/sauce-connect-ready
    - LOGS_DIR=/tmp/logs

stages:
  - name: precache
    if: ( branch = development AND type = push ) OR type = pull_request
  - name: lint
    if: ( branch = development AND type = push ) OR type = pull_request
  - name: test
    if: ( branch = development AND type = push ) OR type = pull_request
  - name: build
    if: ( branch = development AND type = push ) OR type = pull_request
  - name: deploy
    if: branch = development AND type = push
  - name: publish
    if: tag =~ ^v2
  - name: sauce-tests
    if: ( branch = development AND type = push ) OR type = pull_request

before_install:
  - export CHROME_BIN=chromium-browser
  - export DISPLAY=:99.0
  - sh -e /etc/init.d/xvfb start
  - rm -rf node_modules/ngx-bootstrap

install:
  - npm install > /dev/null
  - npm run build > /dev/null
  - if [[ "$NGV" == "latest" ]]; then  ./scripts/ci/npm-ng-latest.sh; fi
  - if [[ "$NGV" == "next" ]]; then  ./scripts/ci/npm-ng-next.sh; fi
  - npm i ./dist  > /dev/null
  - if [[ "$TRAVIS_PULL_REQUEST" != false ]]; then export SAUCE_USERNAME=$SAUCE_USERNAME_PR; export SAUCE_ACCESS_KEY=$SAUCE_ACCESS_KEY_PR; fi

jobs:
  fast_finish: true
  allow_failures:
    - env: NGV=next
    - env: SAUCE=true
    - stage: sauce-tests
  include:
# precache npm and apt dependencies
    - stage: precache
      install: npm install > /dev/null
      script: true
      addons:
        chrome: stable
        apt:
          sources:
          - ubuntu-toolchain-r-test
          # required by node-gyp to build some packages
          packages:
          - g++-4.8
#   lint code
    - stage: lint
      install: true
      script: npm run lint
#   test
    - &test
      stage: test
      script: npm run test-coverage
      after_success:
        - ./node_modules/.bin/codecov
    - <<: *test
      env: NGV=latest
    - <<: *test
      env: NGV=next
#    check prod build
    - &build
      stage: build
      script: npm run demo.ng-build
    - <<: *build
      env: NGV=latest
    - <<: *build
      env: NGV=next
    - stage: sauce-tests
      env: SAUCE=true
      before_script:
        - mkdir -p $LOGS_DIR
        - ./scripts/sauce/sauce_connect_setup.sh
      script:
        - ./scripts/sauce/sauce_connect_block.sh
        - npm run test-cross
      after_script: ./scripts/sauce/sauce_connect_teardown.sh
#   deploy to ngx-bootstrap.surge.sh
    - &surge
      stage: deploy
      script: npm run demo.build
      deploy:
        provider: surge
        project: ./gh-pages/
        domain: ngx-bootstrap.surge.sh
        on: development
    - <<: *surge
      env: NGV=latest
      deploy:
        provider: surge
        project: ./gh-pages/
        domain: ngx-bootstrap-latest.surge.sh
        on: development
    - stage: deploy
      script: npm run build:dynamic
      deploy:
        provider: heroku
        api_key: $HEROKU_API_KEY
        skip_cleanup: true
        app: ngx-universal
        on: development
    - stage: publish
      script: npm run demo.build
      after_deploy: npm run flow.github-release
      deploy:
        provider: pages
        local_dir: gh-pages
        skip_cleanup: true
        github_token: $GITHUB_TOKEN
        app: ngx-universal
        on:
          tags: true
    - stage: publish
      script: npm run build
      before_deploy: "cd dist"
      deploy:
        provider: npm
        email: "<EMAIL>"
        api_key: $NPM_AUTH_TOKEN
        tag: next
        skip_cleanup: true
        on:
          tags: true

cache:
  apt: true
  npm: true
  directories:
    - node_modules

{'fraction_non_alphanumeric': 0.10180645161290322, 'fraction_numerical': 0.002064516129032258, 'mean_word_length': 1.9880493446414804, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 15, 'https://': 0, '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': '557094', 'n_tokens_mistral': 2664, 'n_tokens_neox': 2581, 'n_words': 681}