<commit_before>version: 2

references:
    steps: &steps
        working_directory: ~/repo
        steps:
            - checkout
            - run: apt-get -yqq update
            - run: apt-get -yqq install git unzip zip libpq-dev mysql-client libpng-dev
            - run: docker-php-ext-install pdo_pgsql pdo_mysql gd
            - run: curl -sS https://getcomposer.org/installer | php
            - run: chmod +x composer.phar
            - run: mv composer.phar /usr/local/bin/composer
            - run: composer config -g github-oauth.github.com $GITHUB_TOKEN
            - run: composer install -n --prefer-dist --no-progress -o
            - run:
                name: Wait for other docker instances to be up
                command: sleep 10
            - run: mysql --host=127.0.0.1 -e "grant all privileges on *.* to 'testing'@'%' with grant option;"
            - run: php tests/scripts/setup.php
            - run: |
                if [ "${BUILD_WEBSERVER}" = "nginx" ]; then
                    apt-get -yqq install nginx
                fi
            - run: DB_CONNECTION=mysql DB_HOSTNAME=mariadb TENANCY_SYSTEM_CONNECTION_NAME=mysql ./vendor/bin/phpunit -c ci.phpunit.xml
            - run: php tests/scripts/setup.php
            - run: DB_CONNECTION=mysql DB_HOSTNAME=mysql LIMIT_UUID_LENGTH_32=1 TENANCY_SYSTEM_CONNECTION_NAME=mysql ./vendor/bin/phpunit -c ci.phpunit.xml
            - run: php tests/scripts/setup.php
            - run: DB_CONNECTION=pgsql TENANCY_SYSTEM_CONNECTION_NAME=pgsql ./vendor/bin/phpunit -c ci.phpunit.xml
    
    mysql: &mysql
        image: mariadb:latest
        name: mysql
        environment:
            - MYSQL_DATABASE: testing
            - MYSQL_USER: testing
            - MYSQL_PASSWORD: <PASSWORD>
            - MYSQL_ALLOW_EMPTY_PASSWORD: yes
            - MYSQL_ROOT_HOST: "%"
    mariadb: &mariadb
        image: mariadb:latest
        environment:
            - MYSQL_DATABASE: testing
            - MYSQL_USER: testing
            - MYSQL_PASSWORD: testing
            - MYSQL_ALLOW_EMPTY_PASSWORD: yes
            - MYSQL_ROOT_HOST: "%"
    pgsql: &pgsql
        image: postgres:latest
        environment:
            - POSTGRES_DB: testing
            - POSTGRES_USER: testing
            - POSTGRES_PASSWORD: <PASSWORD>
    environment: &environment
        - DB_DATABASE: testing
        - DB_USERNAME: testing
        - DB_PASSWORD: <PASSWORD>
        - APP_KEY: deela5kinohw0haekoothahSh8eexach

jobs:
    "php-7.0-apache":
        docker:
            - image: php:7.0-apache
              environment: *environment
            - *mysql
            - *mariadb
            - *pgsql
        <<: *steps
    "php-7.1-apache":
        docker:
            - image: php:7.1-apache
              environment: *environment
            - *mysql
            - *mariadb
            - *pgsql
        <<: *steps
    "php-7.0-nginx":
        docker:
            - image: php:7.0-fpm
              environment: *environment
            - *mysql
            - *mariadb
            - *pgsql
        <<: *steps
    "php-7.1-nginx":
        docker:
            - image: php:7.1-fpm
              environment: *environment
            - *mysql
            - *mariadb
            - *pgsql
        <<: *steps
    coverage:
        docker:
            - image: php:7.1
              environment: *environment
        working_directory: ~/repo
        steps:
            - checkout
            - run: apt-get -yqq update
            - run: apt-get -yqq install git unzip zip libpq-dev mysql-client libpng-dev
            - run: pecl install xdebug
            - run: docker-php-ext-enable xdebug
            - run: curl -sS https://getcomposer.org/installer | php
            - run: chmod +x composer.phar
            - run: mv composer.phar /usr/local/bin/composer
            - run: composer config -g github-oauth.github.com $GITHUB_TOKEN
            - run: php tests/scripts/setup.php
            - run: vendor/bin/phpunit -d memory_limit=1G --coverage-clover=coverage.xml -c ci.phpunit.xml
            - run: bash <(curl -s https://codecov.io/bash)
            

workflows:
    version: 2
    test:
        jobs:
            - "php-7.0-apache"
            - "php-7.1-apache"<commit_msg>makes sense to install dependencies :roll_eyes:<commit_after>version: 2

references:
    steps: &steps
        working_directory: ~/repo
        steps:
            - checkout
            - run: apt-get -yqq update
            - run: apt-get -yqq install git unzip zip libpq-dev mysql-client libpng-dev
            - run: docker-php-ext-install pdo_pgsql pdo_mysql gd
            - run: curl -sS https://getcomposer.org/installer | php
            - run: chmod +x composer.phar
            - run: mv composer.phar /usr/local/bin/composer
            - run: composer config -g github-oauth.github.com $GITHUB_TOKEN
            - run: composer install -n --prefer-dist --no-progress -o
            - run:
                name: Wait for other docker instances to be up
                command: sleep 10
            - run: mysql --host=127.0.0.1 -e "grant all privileges on *.* to 'testing'@'%' with grant option;"
            - run: php tests/scripts/setup.php
            - run: |
                if [ "${BUILD_WEBSERVER}" = "nginx" ]; then
                    apt-get -yqq install nginx
                fi
            - run: DB_CONNECTION=mysql DB_HOSTNAME=mariadb TENANCY_SYSTEM_CONNECTION_NAME=mysql ./vendor/bin/phpunit -c ci.phpunit.xml
            - run: php tests/scripts/setup.php
            - run: DB_CONNECTION=mysql DB_HOSTNAME=mysql LIMIT_UUID_LENGTH_32=1 TENANCY_SYSTEM_CONNECTION_NAME=mysql ./vendor/bin/phpunit -c ci.phpunit.xml
            - run: php tests/scripts/setup.php
            - run: DB_CONNECTION=pgsql TENANCY_SYSTEM_CONNECTION_NAME=pgsql ./vendor/bin/phpunit -c ci.phpunit.xml
    
    mysql: &mysql
        image: mariadb:latest
        name: mysql
        environment:
            - MYSQL_DATABASE: testing
            - MYSQL_USER: testing
            - MYSQL_PASSWORD: <PASSWORD>
            - MYSQL_ALLOW_EMPTY_PASSWORD: yes
            - MYSQL_ROOT_HOST: "%"
    mariadb: &mariadb
        image: mariadb:latest
        environment:
            - MYSQL_DATABASE: testing
            - MYSQL_USER: testing
            - MYSQL_PASSWORD: <PASSWORD>
            - MYSQL_ALLOW_EMPTY_PASSWORD: yes
            - MYSQL_ROOT_HOST: "%"
    pgsql: &pgsql
        image: postgres:latest
        environment:
            - POSTGRES_DB: testing
            - POSTGRES_USER: testing
            - POSTGRES_PASSWORD: <PASSWORD>
    environment: &environment
        - DB_DATABASE: testing
        - DB_USERNAME: testing
        - DB_PASSWORD: <PASSWORD>
        - APP_KEY: deela5kinohw0haekoothahSh8eexach

jobs:
    "php-7.0-apache":
        docker:
            - image: php:7.0-apache
              environment: *environment
            - *mysql
            - *mariadb
            - *pgsql
        <<: *steps
    "php-7.1-apache":
        docker:
            - image: php:7.1-apache
              environment: *environment
            - *mysql
            - *mariadb
            - *pgsql
        <<: *steps
    "php-7.0-nginx":
        docker:
            - image: php:7.0-fpm
              environment: *environment
            - *mysql
            - *mariadb
            - *pgsql
        <<: *steps
    "php-7.1-nginx":
        docker:
            - image: php:7.1-fpm
              environment: *environment
            - *mysql
            - *mariadb
            - *pgsql
        <<: *steps
    coverage:
        docker:
            - image: php:7.1
              environment: *environment
        working_directory: ~/repo
        steps:
            - checkout
            - run: apt-get -yqq update
            - run: apt-get -yqq install git unzip zip
            - run: pecl install xdebug
            - run: docker-php-ext-enable xdebug
            - run: curl -sS https://getcomposer.org/installer | php
            - run: chmod +x composer.phar
            - run: mv composer.phar /usr/local/bin/composer
            - run: composer config -g github-oauth.github.com $GITHUB_TOKEN
            - run: composer install -n --prefer-dist --no-progress -o
            - run: php tests/scripts/setup.php
            - run: vendor/bin/phpunit -d memory_limit=1G --coverage-clover=coverage.xml -c ci.phpunit.xml
            - run: bash <(curl -s https://codecov.io/bash)
            

workflows:
    version: 2
    test:
        jobs:
            - "php-7.0-apache"
            - "php-7.1-apache"
{'fraction_non_alphanumeric': 0.09984818404764685, 'fraction_numerical': 0.009108957141188836, 'mean_word_length': 1.4419731964642144, 'pattern_counts': {'":': 8, '<': 28, '<?xml version=': 0, '>': 10, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, 'pii_count': 2, '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': '4851046', 'n_tokens_mistral': 2731, 'n_tokens_neox': 2674, 'n_words': 576}