<commit_before># This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0
#
# http://docs.travis-ci.com/user/customizing-the-build/
# http://lint.travis-ci.org/

os:       linux
dist:     xenial
language: generic
services: docker

cache:
  directories:
    - ~/cache/
    - ~/beast/
    # We use $PIPE to carry cache context along job pipelines (workflows)
    # https://docs.travis-ci.com/user/caching/

# Common scripts
install: |
  touch ~/cache/"$PIPELINE-$TRAVIS_BUILD_STAGE_NAME" && ls -l ~/cache/ && cd ~/beast/

# Job pipelines
jobs:
  include:

    # == 'Gcc' Pipeline ==
    # Build a highly optimized Gcc and upload it.
    - stage: Stage1
      name: "GCC-1 (autogen.sh)"
      env: PIPELINE=Gcc
      before_install: |
        rm -v -rf ~/cache/* ~/beast && travis_retry git fetch --unshallow && cd .. && mv beast ~/
      script: |
        misc/cibuild.sh gcc
    - stage: Stage2
      name: "GCC-2 (appimage + check + bintray)"
      env: PIPELINE=Gcc
      script: |
        misc/cibuild.sh appimage check && {
          echo "$BINTRAY_API_KEY" > .bintray_api_key &&
          test "$TRAVIS_BRANCH^$TRAVIS_PULL_REQUEST" != "master^false" ||
          misc/cibuild.sh bintray ; }

    # == Stage3 Fedora ==
    # Fedora build tests, runs *after* the 'appimage' succeeded
    - stage: Stage3
      name: "Fedora-27 (build + check)"
      env: PIPELINE=Fedora-27
      before_install: |
        rm -v -rf ~/cache/* ~/beast && travis_retry git fetch --unshallow && cd .. && mv beast ~/
      script: |
        docker build --build-arg DIST=fedora:27 -f misc/Dockerfile-yum -t beast-fedora-27 .

    # == 'Linting' Pipeline ==
    # Generate all possible source code linting reports,
    # sort slow jobs into separate stages to avoid timeouts.
    - stage: Stage1
      name: "Linting-1 (autogen.sh)"
      env: PIPELINE=clang
      before_install: |
        rm -v -rf ~/cache/* ~/beast && travis_retry git fetch --unshallow && cd .. && mv beast ~/
      script: |
        misc/cibuild.sh quick
    - stage: Stage2
      name: "Linting-2 (cppcheck + scan-build)"
      env: PIPELINE=clang
      script: |
        misc/cibuild.sh cppcheck scan-build
    - stage: Stage3
      name: "Linting-3 (clang-tidy + listunused + listhacks + bintray)"
      env: PIPELINE=clang
      script: |
        misc/cibuild.sh clang-tidy &&
        echo "$BINTRAY_API_KEY" > .bintray_api_key &&
        misc/cibuild.sh listunused listhacks bintray

    # == 'Asan' Pipeline ==
    # Run checks with asan turned on.
    - stage: Stage1
      name: "Asan-1 (autogen.sh)"
      env: PIPELINE=clang
      before_install: |
        rm -v -rf ~/cache/* ~/beast && travis_retry git fetch --unshallow && cd .. && mv beast ~/
      script: |
        misc/cibuild.sh asan
    - stage: Stage2
      name: "Asan-2 (check)"
      env: PIPELINE=clang
      script: |
        mkdir -p out/asan/ &&
        misc/cibuild.sh all check |& tee out/asan/build.log || :
        echo "$BINTRAY_API_KEY" > .bintray_api_key &&
        misc/cibuild.sh bintray

notifications:
  irc:
    channels:
      - "irc.gimp.org#beast"
    on_success: always
    on_failure: always
    skip_join: true
  email: false
    #recipients:
    #  - <EMAIL>
    #on_success: never
    #on_failure: change<commit_msg>.travis.yml: add asan test to allow_failures<commit_after># This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0
#
# http://docs.travis-ci.com/user/customizing-the-build/
# http://lint.travis-ci.org/

os:       linux
dist:     xenial
language: generic
services: docker

cache:
  directories:
    - ~/cache/
    - ~/beast/
    # We use $PIPE to carry cache context along job pipelines (workflows)
    # https://docs.travis-ci.com/user/caching/

# Common scripts
install: |
  touch ~/cache/"$PIPELINE-$TRAVIS_BUILD_STAGE_NAME" && ls -l ~/cache/ && cd ~/beast/

# Job pipelines
jobs:
  include:

    # == 'Gcc' Pipeline ==
    # Build a highly optimized Gcc and upload it.
    - stage: Stage1
      name: "GCC-1 (autogen.sh)"
      env: PIPELINE=Gcc
      before_install: |
        rm -v -rf ~/cache/* ~/beast && travis_retry git fetch --unshallow && cd .. && mv beast ~/
      script: |
        misc/cibuild.sh gcc
    - stage: Stage2
      name: "GCC-2 (appimage + check + bintray)"
      env: PIPELINE=Gcc
      script: |
        misc/cibuild.sh appimage check && {
          echo "$BINTRAY_API_KEY" > .bintray_api_key &&
          test "$TRAVIS_BRANCH^$TRAVIS_PULL_REQUEST" != "master^false" ||
          misc/cibuild.sh bintray ; }

    # == Stage3 Fedora ==
    # Fedora build tests, runs *after* the 'appimage' succeeded
    - stage: Stage3
      name: "Fedora-27 (build + check)"
      env: PIPELINE=Fedora-27
      before_install: |
        rm -v -rf ~/cache/* ~/beast && travis_retry git fetch --unshallow && cd .. && mv beast ~/
      script: |
        docker build --build-arg DIST=fedora:27 -f misc/Dockerfile-yum -t beast-fedora-27 .

    # == 'Linting' Pipeline ==
    # Generate all possible source code linting reports,
    # sort slow jobs into separate stages to avoid timeouts.
    - stage: Stage1
      name: "Linting-1 (autogen.sh)"
      env: PIPELINE=clang
      before_install: |
        rm -v -rf ~/cache/* ~/beast && travis_retry git fetch --unshallow && cd .. && mv beast ~/
      script: |
        misc/cibuild.sh quick
    - stage: Stage2
      name: "Linting-2 (cppcheck + scan-build)"
      env: PIPELINE=clang
      script: |
        misc/cibuild.sh cppcheck scan-build
    - stage: Stage3
      name: "Linting-3 (clang-tidy + listunused + listhacks + bintray)"
      env: PIPELINE=clang
      script: |
        misc/cibuild.sh clang-tidy &&
        echo "$BINTRAY_API_KEY" > .bintray_api_key &&
        misc/cibuild.sh listunused listhacks bintray

    # == 'Asan' Pipeline ==
    # Run checks with asan turned on.
    - stage: Stage1
      name: "Asan-1 (autogen.sh)"
      env: PIPELINE=clang
      before_install: |
        rm -v -rf ~/cache/* ~/beast && travis_retry git fetch --unshallow && cd .. && mv beast ~/
      script: |
        misc/cibuild.sh asan
    - stage: Stage2
      name: "Asan-2 (check)"
      env: PIPELINE=clang
      before_script: |
        echo "$BINTRAY_API_KEY" > .bintray_api_key
      script: |
        misc/ciwitness.sh out/asan/build.log all check bintray

  # == allow_failures ==
  allow_failures:
    - script: |
        misc/ciwitness.sh out/asan/build.log all check bintray

notifications:
  irc:
    channels:
      - "irc.gimp.org#beast"
    on_success: always
    on_failure: always
    skip_join: true
  email: false
    #recipients:
    #  - <EMAIL>
    #on_success: never
    #on_failure: change
{'fraction_non_alphanumeric': 0.13126312631263126, 'fraction_numerical': 0.0084008400840084, 'mean_word_length': 2.222329627839536, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 2, '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': '5845183', 'n_tokens_mistral': 2465, 'n_tokens_neox': 2395, 'n_words': 580}