<commit_before>version: 2
jobs:
  build:
    working_directory: /app
    docker:
      - image: centos:7
      - image: postgres:11
        name: postgres
        environment:
          POSTGRES_USER: statink
          POSTGRES_PASSWORD: statink
          POSTGRES_DB: statink
          POSTGRES_INITDB_ARGS: "-E UTF-8 --locale=en_US.UTF8 -k"

    steps:
      - run: yum update -y
      - run: yum install -y curl epel-release gnupg2 scl-utils 'http://rpms.famillecollet.com/enterprise/remi-release-7.rpm'
      - run: curl -fsSL 'https://rpm.nodesource.com/setup_10.x' | bash -
      - run: yum-config-manager --add-repo 'https://rpm.fetus.jp/jp3cki.repo'
      - run: yum-config-manager --disable jp3cki*
      - run: yum-config-manager --enable jp3cki-h2o-mainline
      - run: yum install -y ImageMagick brotli diffutils gcc-c++ git gzip h2o jpegoptim make nodejs patch php73-php-cli php73-php-fpm php73-php-gd php73-php-intl php73-php-json php73-php-mbstring php73-php-mcrypt php73-php-opcache php73-php-pdo php73-php-pecl-msgpack php73-php-pecl-zip php73-php-pgsql php73-php-process php73-php-xml php73-runtime supervisor unzip
      - checkout
      - restore_cache:
          keys:
            - php-dependencies-v1-{{ checksum "composer.lock" }}
            - php-dependencies-v1-
      - restore_cache:
          keys:
            - js-node10-dependencies-v2-{{ checksum "package-lock.json" }}
            - js-node10-dependencies-v2-
      - run: scl enable php73 -- make check-syntax
      - run: scl enable php73 -- make init
      - save_cache:
          key: php-dependencies-v1-{{ checksum "composer.lock" }}
          paths:
            - ./vendor
      - save_cache:
          key: js-node12-dependencies-v1-{{ checksum "package-lock.json" }}
          paths:
            - ./node_modules
      - run: scl enable php73 -- ./yii secret/db postgres statink
      - run: scl enable php73 -- make
      - run: scl enable php73 -- make -j3 check-style

  build4next:
    working_directory: /app
    docker:
      - image: centos:7
      - image: postgres:12
        name: postgres
        environment:
          POSTGRES_USER: statink
          POSTGRES_PASSWORD: statink
          POSTGRES_DB: statink
          POSTGRES_INITDB_ARGS: "-E UTF-8 --locale=en_US.UTF8 -k"

    steps:
      - run: yum update -y
      - run: yum install -y curl epel-release gnupg2 scl-utils 'http://rpms.famillecollet.com/enterprise/remi-release-7.rpm'
      - run: curl -fsSL 'https://rpm.nodesource.com/setup_11.x' | bash -
      - run: yum-config-manager --add-repo 'https://rpm.fetus.jp/jp3cki.repo'
      - run: yum-config-manager --disable jp3cki*
      - run: yum-config-manager --enable jp3cki-h2o-mainline
      - run: yum install -y ImageMagick brotli diffutils gcc-c++ git gzip h2o jpegoptim make nodejs patch php74-php-cli php74-php-fpm php74-php-gd php74-php-intl php74-php-json php74-php-mbstring php74-php-mcrypt php74-php-opcache php74-php-pdo php74-php-pecl-msgpack php74-php-pecl-zip php74-php-pgsql php74-php-process php74-php-sodium php74-php-xml php74-runtime supervisor unzip
      - checkout
      - restore_cache:
          keys:
            - php-dependencies-v1-{{ checksum "composer.lock" }}
            - php-dependencies-v1-
      - restore_cache:
          keys:
            - js-node11-dependencies-v2-{{ checksum "package-lock.json" }}
            - js-node11-dependencies-v2-
      - run: scl enable php74 -- make check-syntax
      - run: scl enable php74 -- make init
      - save_cache:
          key: js-node11-dependencies-v1-{{ checksum "package-lock.json" }}
          paths:
            - ./node_modules
      - run: scl enable php74 -- ./yii secret/db postgres statink
      - run: scl enable php74 -- make

  build_el8:
    working_directory: /app
    docker:
      - image: centos:8
      - image: postgres:12
        name: postgres
        environment:
          POSTGRES_USER: statink
          POSTGRES_PASSWORD: statink
          POSTGRES_DB: statink
          POSTGRES_INITDB_ARGS: "-E UTF-8 --locale=en_US.UTF8 -k"

    steps:
      # TODO: Should be updated to use Python 3.6
      - run: dnf update -y
      - run: dnf install -y epel-release
      - run: |
          sed -i.bak \
            -e 's%^metalink=%#metalink=%' \
            -e 's%^\(\[epel\]\)%\1\nbaseurl=https://download.fedoraproject.org/pub/epel/$releasever/Everything/$basearch https://ewr.edge.kernel.org/fedora-buffet/epel/$releasever/Everything/$basearch/ https://sjc.edge.kernel.org/fedora-buffet/epel/$releasever/Everything/$basearch/ http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/$releasever/Everything/$basearch/ http://ftp.riken.jp/Linux/fedora/epel/$releasever/Everything/$basearch/%' \
            /etc/yum.repos.d/epel.repo
      - run: dnf install -y 'dnf-command(config-manager)' 'https://rpms.remirepo.net/enterprise/remi-release-8.rpm'
      - run: dnf module enable -y 'php:remi-7.4' 'nodejs:12' 'python27:2.7'
      - run: dnf config-manager --add-repo 'https://rpm.fetus.jp/jp3cki.repo'
      - run: dnf config-manager --save --disable jp3cki*
      - run: dnf config-manager --save --enable jp3cki-h2o-mainline
      - run: |
          dnf install -y \
            @python27 \
            ImageMagick \
            brotli \
            diffutils \
            gcc-c++ \
            git \
            gzip \
            h2o \
            jpegoptim \
            make \
            nodejs \
            patch \
            php-cli \
            php-fpm \
            php-gd \
            php-intl \
            php-json \
            php-mbstring \
            php-mcrypt \
            php-opcache \
            php-pdo \
            php-pecl-msgpack \
            php-pecl-zip \
            php-pgsql \
            php-process \
            php-sodium \
            php-xml \
            unzip
      - run: alternatives --set python /usr/bin/python2
      - checkout
      - restore_cache:
          keys:
            - el8-php74-dependencies-v1-{{ checksum "composer.lock" }}
            - el8-php74-dependencies-v1-
      - restore_cache:
          keys:
            - el8-js-node12-dependencies-v1-{{ checksum "package-lock.json" }}
            - el8-js-node12-dependencies-v1-
      - run: make check-syntax
      - run: make init
      - save_cache:
          key: el8-php74-dependencies-v1-{{ checksum "composer.lock" }}<commit_msg>Remove "make check-syntax" from Circle CI<commit_after>version: 2
jobs:
  build:
    working_directory: /app
    docker:
      - image: centos:7
      - image: postgres:11
        name: postgres
        environment:
          POSTGRES_USER: statink
          POSTGRES_PASSWORD: <PASSWORD>
          POSTGRES_DB: statink
          POSTGRES_INITDB_ARGS: "-E UTF-8 --locale=en_US.UTF8 -k"

    steps:
      - run: yum update -y
      - run: yum install -y curl epel-release gnupg2 scl-utils 'http://rpms.famillecollet.com/enterprise/remi-release-7.rpm'
      - run: curl -fsSL 'https://rpm.nodesource.com/setup_10.x' | bash -
      - run: yum-config-manager --add-repo 'https://rpm.fetus.jp/jp3cki.repo'
      - run: yum-config-manager --disable jp3cki*
      - run: yum-config-manager --enable jp3cki-h2o-mainline
      - run: yum install -y ImageMagick brotli diffutils gcc-c++ git gzip h2o jpegoptim make nodejs patch php73-php-cli php73-php-fpm php73-php-gd php73-php-intl php73-php-json php73-php-mbstring php73-php-mcrypt php73-php-opcache php73-php-pdo php73-php-pecl-msgpack php73-php-pecl-zip php73-php-pgsql php73-php-process php73-php-xml php73-runtime supervisor unzip
      - checkout
      - restore_cache:
          keys:
            - php-dependencies-v1-{{ checksum "composer.lock" }}
            - php-dependencies-v1-
      - restore_cache:
          keys:
            - js-node10-dependencies-v2-{{ checksum "package-lock.json" }}
            - js-node10-dependencies-v2-
      - run: scl enable php73 -- make init
      - save_cache:
          key: php-dependencies-v1-{{ checksum "composer.lock" }}
          paths:
            - ./vendor
      - save_cache:
          key: js-node12-dependencies-v1-{{ checksum "package-lock.json" }}
          paths:
            - ./node_modules
      - run: scl enable php73 -- ./yii secret/db postgres statink
      - run: scl enable php73 -- make
      - run: scl enable php73 -- make -j3 check-style

  build4next:
    working_directory: /app
    docker:
      - image: centos:7
      - image: postgres:12
        name: postgres
        environment:
          POSTGRES_USER: statink
          POSTGRES_PASSWORD: <PASSWORD>
          POSTGRES_DB: statink
          POSTGRES_INITDB_ARGS: "-E UTF-8 --locale=en_US.UTF8 -k"

    steps:
      - run: yum update -y
      - run: yum install -y curl epel-release gnupg2 scl-utils 'http://rpms.famillecollet.com/enterprise/remi-release-7.rpm'
      - run: curl -fsSL 'https://rpm.nodesource.com/setup_11.x' | bash -
      - run: yum-config-manager --add-repo 'https://rpm.fetus.jp/jp3cki.repo'
      - run: yum-config-manager --disable jp3cki*
      - run: yum-config-manager --enable jp3cki-h2o-mainline
      - run: yum install -y ImageMagick brotli diffutils gcc-c++ git gzip h2o jpegoptim make nodejs patch php74-php-cli php74-php-fpm php74-php-gd php74-php-intl php74-php-json php74-php-mbstring php74-php-mcrypt php74-php-opcache php74-php-pdo php74-php-pecl-msgpack php74-php-pecl-zip php74-php-pgsql php74-php-process php74-php-sodium php74-php-xml php74-runtime supervisor unzip
      - checkout
      - restore_cache:
          keys:
            - php-dependencies-v1-{{ checksum "composer.lock" }}
            - php-dependencies-v1-
      - restore_cache:
          keys:
            - js-node11-dependencies-v2-{{ checksum "package-lock.json" }}
            - js-node11-dependencies-v2-
      - run: scl enable php74 -- make init
      - save_cache:
          key: js-node11-dependencies-v1-{{ checksum "package-lock.json" }}
          paths:
            - ./node_modules
      - run: scl enable php74 -- ./yii secret/db postgres statink
      - run: scl enable php74 -- make

  build_el8:
    working_directory: /app
    docker:
      - image: centos:8
      - image: postgres:12
        name: postgres
        environment:
          POSTGRES_USER: statink
          POSTGRES_PASSWORD: statink
          POSTGRES_DB: statink
          POSTGRES_INITDB_ARGS: "-E UTF-8 --locale=en_US.UTF8 -k"

    steps:
      # TODO: Should be updated to use Python 3.6
      - run: dnf update -y
      - run: dnf install -y epel-release
      - run: |
          sed -i.bak \
            -e 's%^metalink=%#metalink=%' \
            -e 's%^\(\[epel\]\)%\1\nbaseurl=https://download.fedoraproject.org/pub/epel/$releasever/Everything/$basearch https://ewr.edge.kernel.org/fedora-buffet/epel/$releasever/Everything/$basearch/ https://sjc.edge.kernel.org/fedora-buffet/epel/$releasever/Everything/$basearch/ http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/$releasever/Everything/$basearch/ http://ftp.riken.jp/Linux/fedora/epel/$releasever/Everything/$basearch/%' \
            /etc/yum.repos.d/epel.repo
      - run: dnf install -y 'dnf-command(config-manager)' 'https://rpms.remirepo.net/enterprise/remi-release-8.rpm'
      - run: dnf module enable -y 'php:remi-7.4' 'nodejs:12' 'python27:2.7'
      - run: dnf config-manager --add-repo 'https://rpm.fetus.jp/jp3cki.repo'
      - run: dnf config-manager --save --disable jp3cki*
      - run: dnf config-manager --save --enable jp3cki-h2o-mainline
      - run: |
          dnf install -y \
            @python27 \
            ImageMagick \
            brotli \
            diffutils \
            gcc-c++ \
            git \
            gzip \
            h2o \
            jpegoptim \
            make \
            nodejs \
            patch \
            php-cli \
            php-fpm \
            php-gd \
            php-intl \
            php-json \
            php-mbstring \
            php-mcrypt \
            php-opcache \
            php-pdo \
            php-pecl-msgpack \
            php-pecl-zip \
            php-pgsql \
            php-process \
            php-sodium \
            php-xml \
            unzip
      - run: alternatives --set python /usr/bin/python2
      - checkout
      - restore_cache:
          keys:
            - el8-php74-dependencies-v1-{{ checksum "composer.lock" }}
            - el8-php74-dependencies-v1-
      - restore_cache:
          keys:
            - el8-js-node12-dependencies-v1-{{ checksum "package-lock.json" }}
            - el8-js-node12-dependencies-v1-
      - run: make init
      - save_cache:
          key: el8-php74-dependencies-v1-{{ checksum "composer.lock" }}
{'fraction_non_alphanumeric': 0.12374396708600365, 'fraction_numerical': 0.028166785346942006, 'mean_word_length': 1.7520139342477683, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 18, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1415810', 'n_tokens_mistral': 4720, 'n_tokens_neox': 4276, 'n_words': 834}