<commit_before>os:
  - linux
cache: apt
env:
  global:
   # GH_TOKEN=[secure]             (to push to osx/windows repo under soonhokong)
   - secure: "<KEY>
   # REPO=BLESSED                  (to perform extra stuff only for pushes to the blessed repo)
   - secure: "<KEY>
  matrix:
   - EVM_EMACS=emacs-24.3-bin
   - EVM_EMACS=emacs-24.4-bin
   - EVM_EMACS=emacs-24.5-bin

before_install:
  - sudo mkdir /usr/local/evm
  - sudo chown travis:travis /usr/local/evm
  - export PATH="/home/travis/.cask/bin:$PATH"
  - export PATH="/home/travis/.evm/bin:$PATH"
  - curl -fsSkL https://raw.github.com/rejeep/evm/master/go | bash
  - evm install $EVM_EMACS --use
  - curl -fsSkL https://raw.github.com/cask/cask/master/go | python
  - cask
  - evm list
  - sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test
  - sudo add-apt-repository --yes ppa:kalakris/cmake
  - sudo apt-get update
  - sudo apt-get install mercurial python2.7 texlive-latex-recommended texlive-humanities texlive-xetex texlive-science texlive-latex-extra texlive-fonts-recommended latexmk bibtex2html moreutils nodejs nodejs-legacy || true
  - tar xvfz header/l3kernel.tar.gz -C ~/

install:
  # Install Lean dependencies
  - sudo apt-get -qq install g++-4.8 libstdc++-4.8-dev libgmp-dev libmpfr-dev lua5.2-dev cmake
  - npm -g i cssmin minify
  # Build Lean
  - git clone https://github.com/leanprover/lean
  - cd lean
  - mkdir build
  - cd build
  - cmake -DIGNORE_SORRY=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-4.8 ../src
  - make
  - sudo make install
  - cd ../../

script:
  - EMACS_BIN=$(evm bin $EVM_EMACS) make
  # Build completion.js
  - echo "var completions = [" > js/completion.js
  - lean --server < js/completion_input.in | grep "|" | grep -v "^private\." | sort | uniq | sed -e "s/\([^|]\+\)|\(.\+\)/{name:\"\1\", value:\"\1\", meta:\"\2\"},/" >> js/completion.js
  - echo "]" >> js/completion.js
  # Build input-method.js
  - $(evm bin $EVM_EMACS) --no-site-file --no-site-lisp -q --batch -l ./elisp/org-html-export.el -l ./lean/src/emacs/lean-input.el -f lean-input-export-translations-to-stdout > js/input-method.js
  # Push to gh-pages
  - if [[ "${REPO}" == "BLESSED" ]] && [[ "${TRAVIS_PULL_REQUEST}" == "false" ]] ; then
      git config --global user.email "<EMAIL>" &&
      git config --global user.name "<NAME>" &&
      git checkout --orphan gh-pages &&
      rm -f .git/index &&
      git add -f *.html tutorial.pdf &&
      for CSS in css/*.css; do cssmin ${CSS} | sponge ${CSS} ; done &&
      git add css &&
      git add images &&
      git add fonts &&
      for JS in js/*.js; do minify ${JS} | sponge ${JS} ; done &&
      git add -f js/* &&
      sudo rm -rf pygments-main &&
      git clean -fxd &&
      git commit -m "Update `date -R`" &&
      git push -q https://soonhokong:${GH_TOKEN}@github.com/leanprover/tutorial.git +HEAD:gh-pages &&
      git checkout -f master;
    fi
  # Test
  - make test
  - make test_js

notifications:
  email:
    recipients:
     - <EMAIL><commit_msg>feat(.travis.yml): separate test and test_js<commit_after>os:
  - linux
cache: apt
env:
  global:
   # GH_TOKEN=[secure]             (to push to osx/windows repo under soonhokong)
   - secure: "<KEY>
   # REPO=BLESSED                  (to perform extra stuff only for pushes to the blessed repo)
   - secure: "<KEY>
  matrix:
   - EVM_EMACS=emacs-24.3-bin TEST=TRUE
   - EVM_EMACS=emacs-24.4-bin TEST=TRUE
   - EVM_EMACS=emacs-24.5-bin TEST=TRUE
   - EVM_EMACS=emacs-24.3-bin TEST_JS=TRUE
   - EVM_EMACS=emacs-24.4-bin TEST_JS=TRUE
   - EVM_EMACS=emacs-24.5-bin TEST_JS=TRUE

before_install:
  - sudo mkdir /usr/local/evm
  - sudo chown travis:travis /usr/local/evm
  - export PATH="/home/travis/.cask/bin:$PATH"
  - export PATH="/home/travis/.evm/bin:$PATH"
  - curl -fsSkL https://raw.github.com/rejeep/evm/master/go | bash
  - evm install $EVM_EMACS --use
  - curl -fsSkL https://raw.github.com/cask/cask/master/go | python
  - cask
  - evm list
  - sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test
  - sudo add-apt-repository --yes ppa:kalakris/cmake
  - sudo apt-get update
  - sudo apt-get install mercurial python2.7 texlive-latex-recommended texlive-humanities texlive-xetex texlive-science texlive-latex-extra texlive-fonts-recommended latexmk bibtex2html moreutils nodejs nodejs-legacy || true
  - tar xvfz header/l3kernel.tar.gz -C ~/

install:
  # Install Lean dependencies
  - sudo apt-get -qq install g++-4.8 libstdc++-4.8-dev libgmp-dev libmpfr-dev lua5.2-dev cmake
  - npm -g i cssmin minify
  # Build Lean
  - git clone https://github.com/leanprover/lean
  - cd lean
  - mkdir build
  - cd build
  - cmake -DIGNORE_SORRY=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-4.8 ../src
  - make
  - sudo make install
  - cd ../../

script:
  - EMACS_BIN=$(evm bin $EVM_EMACS) make
  # Build completion.js
  - echo "var completions = [" > js/completion.js
  - lean --server < js/completion_input.in | grep "|" | grep -v "^private\." | sort | uniq | sed -e "s/\([^|]\+\)|\(.\+\)/{name:\"\1\", value:\"\1\", meta:\"\2\"},/" >> js/completion.js
  - echo "]" >> js/completion.js
  # Build input-method.js
  - $(evm bin $EVM_EMACS) --no-site-file --no-site-lisp -q --batch -l ./elisp/org-html-export.el -l ./lean/src/emacs/lean-input.el -f lean-input-export-translations-to-stdout > js/input-method.js
  # Push to gh-pages
  - if [[ "${REPO}" == "BLESSED" ]] && [[ "${TRAVIS_PULL_REQUEST}" == "false" ]] ; then
      git config --global user.email "<EMAIL>" &&
      git config --global user.name "<NAME>" &&
      git checkout --orphan gh-pages &&
      rm -f .git/index &&
      git add -f *.html tutorial.pdf &&
      for CSS in css/*.css; do cssmin ${CSS} | sponge ${CSS} ; done &&
      git add css &&
      git add images &&
      git add fonts &&
      for JS in js/*.js; do minify ${JS} | sponge ${JS} ; done &&
      git add -f js/* &&
      sudo rm -rf pygments-main &&
      git clean -fxd &&
      git commit -m "Update `date -R`" &&
      git push -q https://soonhokong:${GH_TOKEN}@github.com/leanprover/tutorial.git +HEAD:gh-pages &&
      git checkout -f master;
    fi
  # Test
  - if [[ $TEST == TRUE ]] ; then
        make -j2 test;
    fi
  - if [[ $TEST_JS == TRUE ]] ; then
        make -j2 test_js;
    fi

notifications:
  email:
    recipients:
     - <EMAIL>
{'fraction_non_alphanumeric': 0.16247030878859858, 'fraction_numerical': 0.00934283452098179, 'mean_word_length': 2.4779735682819384, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 25, 'https://': 8, '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': '701577', 'n_tokens_mistral': 2513, 'n_tokens_neox': 2383, 'n_words': 570}