<commit_before>version: 2
jobs:
  init:
    working_directory: ~/grow
    docker:
      - image: grow/grow-internal-image
    steps:
      - checkout

      - restore_cache:
          key: ui-{{ .Branch }}-{{ checksum "grow/ui/package.json" }}

      - run:
          name: Build UI
          command: make build-ui

      - save_cache:
          key: ui-{{ .Branch }}-{{ checksum "grow/ui/package.json" }}
          paths:
            - "grow/ui/node_modules"

      # Setup the pip cache before running other commands.
      - run:
          name: Virtual Env
          command: virtualenv env --distribute

      - restore_cache:
          key: pip-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}

      - run:
          name: Pip Install
          command: |
            set -e
            . env/bin/activate
            pip install -r requirements-dev.txt
            pip install gaenv
            pip install coveralls
            pip install NoseGAE==0.5.10

      - save_cache:
          key: pip-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}
          paths:
            - "env"

      - persist_to_workspace:
          root: ~/grow
          paths:
            - .coveragerc
            - .git/*
            - bin/*
            - grow/*
            - grow.spec
            - install.py
            - Makefile
            - MANIFEST.in
            - package.json
            - pylintrc
            - requirements-dev.txt
            - requirements.txt
            - setup.py

  pylint:
    working_directory: ~/grow
    docker:
      - image: grow/grow-internal-image
    steps:
      - attach_workspace:
          at: ~/grow

      - run:
          name: Virtual Env
          command: virtualenv env --distribute

      - restore_cache:
          key: pip-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}

      - run:
          name: Pip Install
          command: |
            set -e
            . env/bin/activate
            pip install -r requirements-dev.txt

      - run:
          name: Pylint
          command: make test-pylint-circle

      - save_cache:
          key: pip-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}
          paths:
            - "env"

  release-package-linux:
    working_directory: ~/grow
    docker:
      - image: grow/grow-internal-image
    steps:
      - attach_workspace:
          at: ~/grow

      - run:
          name: Virtual Env
          command: virtualenv env --distribute

      - restore_cache:
          key: pip-release-linux-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}

      - run:
          name: Pip Install
          command: |
            set -e
            . env/bin/activate
            pip install -r requirements-dev.txt
            pip install pyinstaller==3.3

      - save_cache:
          key: pip-release-linux-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}
          paths:
            - "env"

      - run:
          name: Build Release
          command: |
            set -e
            . env/bin/activate
            pyinstaller grow.spec

      - run:
          name: Package
          command: |
            set -e
            cd dist
            zip -r Grow-SDK-Linux-CIRCLE_TAG.zip grow
            cd ..

      # Currently causes a seg fault in docker.
      # - run:
      #     name: Test Packaged Grow
      #     command: ./dist/grow
      #
      # - run:
      #     name: Test Packaged Grow Build
      #     command: ./dist/grow build ./grow/testing/testdata/pod

      - run:
          name: Upload to GitHub
          command: ghr -draft -u grow 0.3.16 dist/Grow-SDK-Linux-CIRCLE_TAG.zip

      - store_artifacts:
          path: dist/

  release-package-osx:
    working_directory: ~/grow
    macos:
      xcode: "9.0"
    steps:
      - attach_workspace:
          at: ~/grow

      - run:
          name: Install Go
          command: brew install golang

      - run:
          name: Update Paths
          command: |
            set -e
            export GOROOT=/usr/local/opt/go/libexec
            export GOPATH=$HOME/gocode
            export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

      - run:
          name: Go Version
          command: go version

      - run:
          name: Install ghr
          command: go get -u github.com/tcnksm/ghr

      - run:
          name: Virtual Env
          command: virtualenv env --distribute
<commit_msg>Shifting how the path is updated.<commit_after>version: 2
jobs:
  init:
    working_directory: ~/grow
    docker:
      - image: grow/grow-internal-image
    steps:
      - checkout

      - restore_cache:
          key: ui-{{ .Branch }}-{{ checksum "grow/ui/package.json" }}

      - run:
          name: Build UI
          command: make build-ui

      - save_cache:
          key: ui-{{ .Branch }}-{{ checksum "grow/ui/package.json" }}
          paths:
            - "grow/ui/node_modules"

      # Setup the pip cache before running other commands.
      - run:
          name: Virtual Env
          command: virtualenv env --distribute

      - restore_cache:
          key: pip-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}

      - run:
          name: Pip Install
          command: |
            set -e
            . env/bin/activate
            pip install -r requirements-dev.txt
            pip install gaenv
            pip install coveralls
            pip install NoseGAE==0.5.10

      - save_cache:
          key: pip-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}
          paths:
            - "env"

      - persist_to_workspace:
          root: ~/grow
          paths:
            - .coveragerc
            - .git/*
            - bin/*
            - grow/*
            - grow.spec
            - install.py
            - Makefile
            - MANIFEST.in
            - package.json
            - pylintrc
            - requirements-dev.txt
            - requirements.txt
            - setup.py

  pylint:
    working_directory: ~/grow
    docker:
      - image: grow/grow-internal-image
    steps:
      - attach_workspace:
          at: ~/grow

      - run:
          name: Virtual Env
          command: virtualenv env --distribute

      - restore_cache:
          key: pip-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}

      - run:
          name: Pip Install
          command: |
            set -e
            . env/bin/activate
            pip install -r requirements-dev.txt

      - run:
          name: Pylint
          command: make test-pylint-circle

      - save_cache:
          key: pip-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}
          paths:
            - "env"

  release-package-linux:
    working_directory: ~/grow
    docker:
      - image: grow/grow-internal-image
    steps:
      - attach_workspace:
          at: ~/grow

      - run:
          name: Virtual Env
          command: virtualenv env --distribute

      - restore_cache:
          key: pip-release-linux-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}

      - run:
          name: Pip Install
          command: |
            set -e
            . env/bin/activate
            pip install -r requirements-dev.txt
            pip install pyinstaller==3.3

      - save_cache:
          key: pip-release-linux-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}
          paths:
            - "env"

      - run:
          name: Build Release
          command: |
            set -e
            . env/bin/activate
            pyinstaller grow.spec

      - run:
          name: Package
          command: |
            set -e
            cd dist
            zip -r Grow-SDK-Linux-CIRCLE_TAG.zip grow
            cd ..

      # Currently causes a seg fault in docker.
      # - run:
      #     name: Test Packaged Grow
      #     command: ./dist/grow
      #
      # - run:
      #     name: Test Packaged Grow Build
      #     command: ./dist/grow build ./grow/testing/testdata/pod

      - run:
          name: Upload to GitHub
          command: ghr -draft -u grow 0.3.16 dist/Grow-SDK-Linux-CIRCLE_TAG.zip

      - store_artifacts:
          path: dist/

  release-package-osx:
    working_directory: ~/grow
    macos:
      xcode: "9.0"
    steps:
      - attach_workspace:
          at: ~/grow

      - run:
          name: Install Go
          command: brew install golang

      - run:
          name: Update GOROOT
          command: echo 'export GOROOT=/usr/local/opt/go/libexec' >> $BASH_ENV
      - run:
          name: Update GOPATH
          command: echo 'export GOPATH=$HOME/gocode' >> $BASH_ENV
      - run:
          name: Update PATH
          command: echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> $BASH_ENV

      - run:
          name: Go Version
          command: go version

      - run:
          name: Install ghr
          command: go get -u github.com/tcnksm/ghr

      - run:
          name: Virtual Env
          command: virtualenv env --distribute

{'fraction_non_alphanumeric': 0.11092040334692126, 'fraction_numerical': 0.0027891010512765503, 'mean_word_length': 1.3099603567889, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '4782060', 'n_tokens_mistral': 2813, 'n_tokens_neox': 2720, 'n_words': 671}