<commit_before>branches:
  only:
    - master

sudo: false

cache:
  apt: true
  bundler: true
  directories:
    - $HOME/tools
    - "$TRAVIS_BUILD_DIR/src/$COMPONENT/vendor/bundle"

before_install:
  - curl https://raw.githubusercontent.com/chef/ci-studio-common/master/install.sh | bash
  - export PATH="$PATH:$HOME/ci-studio-common/bin:$HOME/tools/bin"

env:
  global:
    - CAPYBARA_SCREENSHOT_TO_S3=true
    - secure: <KEY>
    - secure: <KEY>

language: ruby
rvm:
  - 2.5.1
bundler_args: "--without development --jobs 7"

notifications:
  email: false
  slack:
    secure: <KEY>

matrix:
  include:

    # Supermarket Spec
    - env:
        - COMPONENT=supermarket
      addons:
        postgresql: '9.3'
        apt:
          packages:
            - libxslt1-dev
            - libxml2-dev
            - libmagic-dev
      services:
        - redis-server
        - postgresql
      before_install:
        - gem install bundler --no-ri --no-rdoc
        - cd $TRAVIS_BUILD_DIR/src/$COMPONENT && bundle config build.nokogiri --use-system-libraries
      before_script:
        - cd $TRAVIS_BUILD_DIR/src/$COMPONENT && bundle exec rake $COMPONENT:travis:before_script
      script:
        - cd $TRAVIS_BUILD_DIR/src/$COMPONENT && bundle exec rake $COMPONENT:travis:script

    # Fieri Spec
    - env:
        - COMPONENT=fieri
      addons:
        postgresql: '9.3'
        apt:
          packages:
            - libxslt1-dev
            - libxml2-dev
            - libmagic-dev
      services:
        - redis-server
        - postgresql
      before_install:
        - gem install bundler --no-ri --no-rdoc
        - cd $TRAVIS_BUILD_DIR/src/$COMPONENT && bundle config build.nokogiri --use-system-libraries
      before_script:
        - cd $TRAVIS_BUILD_DIR/src/$COMPONENT && bundle exec rake $COMPONENT:travis:before_script
      script:
        - cd $TRAVIS_BUILD_DIR/src/$COMPONENT && bundle exec rake $COMPONENT:travis:script

    # Terraform Lint
    - env:
        - NAME=lint-terraform
      install: install-tool terraform
      before_script: cd terraform
      script: make lint

    # supermarket-deploy-cookbook-cookstyle
    - env:
        - NAME=lint-supermarket-deploy-cookbook-cookstyle
      addons:
        apt:
          sources:
            - chef-stable-precise
          packages:
            - chefdk
      cache:
        directories:
          - $HOME/.berkshelf
      install:
        - eval "$(/opt/chefdk/bin/chef shell-init bash)"
      before_script: cd cookbooks/supermarket-deploy
      script: chef exec cookstyle

    # supermarket-deploy-cookbook-foodcritic
    - env:
        - NAME=supermarket-deploy-cookbook-foodcritic
      addons:
        apt:
          sources:
            - chef-stable-precise
          packages:
            - chefdk
      cache:
        directories:
          - $HOME/.berkshelf
      install:
        - eval "$(/opt/chefdk/bin/chef shell-init bash)"
      before_script: cd cookbooks/supermarket-deploy
      script: chef exec foodcritic . -t ~supermarket
<commit_msg>set travis to run test tasks directly<commit_after>branches:
  only:
    - master

sudo: false

cache:
  apt: true
  bundler: true
  directories:
    - $HOME/tools
    - "$TRAVIS_BUILD_DIR/src/$COMPONENT/vendor/bundle"

before_install:
  - curl https://raw.githubusercontent.com/chef/ci-studio-common/master/install.sh | bash
  - export PATH="$PATH:$HOME/ci-studio-common/bin:$HOME/tools/bin"

env:
  global:
    - CAPYBARA_SCREENSHOT_TO_S3=true
    - secure: <KEY>
    - secure: <KEY>

language: ruby
rvm:
  - 2.5.1
bundler_args: "--without development --jobs 7"

notifications:
  email: false
  slack:
    secure: <KEY>

matrix:
  include:

    # Supermarket Spec
    - env:
        - COMPONENT=supermarket
      addons:
        postgresql: '9.3'
        apt:
          packages:
            - libxslt1-dev
            - libxml2-dev
            - libmagic-dev
      services:
        - redis-server
        - postgresql
      before_install:
        - gem install bundler --no-ri --no-rdoc
        - cd $TRAVIS_BUILD_DIR/src/$COMPONENT && bundle config build.nokogiri --use-system-libraries
      before_script:
        - psql -c 'create database supermarket_test;' -U postgres
        - cd $TRAVIS_BUILD_DIR/src/$COMPONENT && bundle exec rake db:schema:load
      script:
        - cd $TRAVIS_BUILD_DIR/src/$COMPONENT
        - bundle exec rake spec
        - bundle exec rubocop
        - bundle exec bundle-audit check --update

    # Fieri Spec
    - env:
        - COMPONENT=fieri
      addons:
        postgresql: '9.3'
        apt:
          packages:
            - libxslt1-dev
            - libxml2-dev
            - libmagic-dev
      services:
        - redis-server
        - postgresql
      before_install:
        - gem install bundler --no-ri --no-rdoc
        - cd $TRAVIS_BUILD_DIR/src/$COMPONENT && bundle config build.nokogiri --use-system-libraries
      script:
        - cd $TRAVIS_BUILD_DIR/src/$COMPONENT
        - bundle exec rake spec
        - bundle exec rubocop
        - bundle exec bundle-audit check --update

    # Terraform Lint
    - env:
        - NAME=lint-terraform
      install: install-tool terraform
      before_script: cd terraform
      script: make lint

    # supermarket-deploy-cookbook-cookstyle
    - env:
        - NAME=lint-supermarket-deploy-cookbook-cookstyle
      addons:
        apt:
          sources:
            - chef-stable-precise
          packages:
            - chefdk
      cache:
        directories:
          - $HOME/.berkshelf
      install:
        - eval "$(/opt/chefdk/bin/chef shell-init bash)"
      before_script: cd cookbooks/supermarket-deploy
      script: chef exec cookstyle

    # supermarket-deploy-cookbook-foodcritic
    - env:
        - NAME=supermarket-deploy-cookbook-foodcritic
      addons:
        apt:
          sources:
            - chef-stable-precise
          packages:
            - chefdk
      cache:
        directories:
          - $HOME/.berkshelf
      install:
        - eval "$(/opt/chefdk/bin/chef shell-init bash)"
      before_script: cd cookbooks/supermarket-deploy
      script: chef exec foodcritic . -t ~supermarket

{'fraction_non_alphanumeric': 0.09938491421171901, 'fraction_numerical': 0.004208481709291033, 'mean_word_length': 1.8137522768670309, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '5576290', 'n_tokens_mistral': 2058, 'n_tokens_neox': 1998, 'n_words': 398}