<commit_before>on:
  - pull_request
  - push

name: build

jobs:
  tests:
    name: PHP ${{ matrix.php-version }}-${{ matrix.os }}
    env:
      extensions-php5: curl, cubrid, mbstring, memcached, dom, intl, json, libxml, pdo, pdo_mysql, pdo_pgsql, pdo_sqlite, xml, xmlwriter
      extensions-php7: curl, cubrid, mbstring, memcached, dom, intl, json, libxml, mysql, pgsql, pdo, pdo_sqlite, xml, xmlwriter
      key-php5: cache-v1
      key-php7: cache-v2

    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os:
          - ubuntu-latest

        php-version:
          - "5.3"
          - "5.4"
          - "5.5"
          - "5.6"
          - "7.0"
          - "7.1"
          - "7.2"
          - "7.3"
          - "7.4"
          - "8.0"

    services:
      mysql:
        image: mysql:5.7
        env:
          MYSQL_USER: test
          MYSQL_PASSWORD: <PASSWORD>
          MYSQL_DATABASE: yii
          MYSQL_ROOT_PASSWORD: <PASSWORD>
        ports:
          - 3306:3306
        options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
      postgres:
        image: postgres:9.6
        env:
          POSTGRES_USER: test
          POSTGRES_PASSWORD: <PASSWORD>
          POSTGRES_DB: yii
        ports:
          - 5432:5432
        options: --name=postgres --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3
      redis:
        image: redis
        options:
          --health-cmd "redis-cli ping"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5

    steps:
      - name: Install service memcached
        uses: niden/actions-memcached@v7

      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup cache environment 5.3 - 5.6
        if: matrix.php-version < '7.0'
        id: cache-env-php5
        uses: shivammathur/cache-extensions@v1
        with:
          php-version: ${{ matrix.php-version }}
          extensions: ${{ env.extensions-php5 }}
          key: ${{ env.key-php5 }}

      - name: Setup cache environment 7.0 - 8.0
        if: matrix.php-version >= '7.0'
        id: cache-env-php7
        uses: shivammathur/cache-extensions@v1
        with:
          php-version: ${{ matrix.php-version }}
          extensions: ${{ env.extensions-php7 }}
          key: ${{ env.key-php7 }}

      - name: Cache extensions 5.3 - 5.6
        if: matrix.php-version < '7.0'
        uses: actions/cache@v1
        with:
          path: ${{ steps.cache-env-php5.outputs.dir }}
          key: ${{ steps.cache-env-php5.outputs.key }}
          restore-keys: ${{ steps.cache-env-php5.outputs.key }}

      - name: Cache extensions 7.0 - 8.0
        if: matrix.php-version >= '7.0'
        uses: actions/cache@v1
        with:
          path: ${{ steps.cache-env-php7.outputs.dir }}
          key: ${{ steps.cache-env-php7.outputs.key }}
          restore-keys: ${{ steps.cache-env-php7.outputs.key }}

      - name: Install PHP with extensions 5.3 - 5.6
        if: matrix.php-version < '7.0'
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php-version }}
          extensions: ${{ env.extensions-php5 }}
          ini-values: date.timezone='UTC'
          coverage: xdebug
          tools: composer:v1, pecl

      - name: Install PHP with extensions 7.0 - 8.0
        if: matrix.php-version >= '7.0'
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php-version }}
          extensions: ${{ env.extensions-php7 }}
          ini-values: date.timezone='UTC'
          coverage: xdebug
          tools: composer:v1, pecl

      - name: Determine composer cache directory on Linux
        run: echo "::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)"

      - name: Cache dependencies installed with composer
        uses: actions/cache@v1
        with:
          path: ${{ env.COMPOSER_CACHE_DIR }}
          key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
          restore-keys: |
            php${{ matrix.php-version }}-composer-<commit_msg>Get MSSQL back<commit_after>on:
  - pull_request
  - push

name: build

jobs:
  tests:
    name: PHP ${{ matrix.php-version }}-${{ matrix.os }}
    env:
      extensions-php5: curl, cubrid, mbstring, memcached, dom, intl, json, libxml, pdo, pdo_mysql, pdo_pgsql, pdo_sqlite, xml, xmlwriter
      extensions-php7: curl, cubrid, mbstring, memcached, dom, intl, json, libxml, mysql, pgsql, pdo, pdo_sqlite, xml, xmlwriter
      key-php5: cache-v1
      key-php7: cache-v2

    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os:
          - ubuntu-latest

        php-version:
          - "5.3"
          - "5.4"
          - "5.5"
          - "5.6"
          - "7.0"
          - "7.1"
          - "7.2"
          - "7.3"
          - "7.4"
          - "8.0"

    services:
      mysql:
        image: mysql:5.7
        env:
          MYSQL_USER: test
          MYSQL_PASSWORD: <PASSWORD>
          MYSQL_DATABASE: yii
          MYSQL_ROOT_PASSWORD: <PASSWORD>
        ports:
          - 3306:3306
        options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
      postgres:
        image: postgres:9.6
        env:
          POSTGRES_USER: test
          POSTGRES_PASSWORD: <PASSWORD>
          POSTGRES_DB: yii
        ports:
          - 5432:5432
        options: --name=postgres --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3
      mssql:
        image: mcr.microsoft.com/mssql/server:2017-latest
        env:
          SA_PASSWORD: <PASSWORD>
          ACCEPT_EULA: Y
          MSSQL_PID: Developer
        ports:
          - 1433:1433
        options: --name=mssql --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P '<PASSWORD>' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3
      redis:
        image: redis
        options:
          --health-cmd "redis-cli ping"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5

    steps:
      - name: Install service memcached
        uses: niden/actions-memcached@v7

      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup cache environment 5.3 - 5.6
        if: matrix.php-version < '7.0'
        id: cache-env-php5
        uses: shivammathur/cache-extensions@v1
        with:
          php-version: ${{ matrix.php-version }}
          extensions: ${{ env.extensions-php5 }}
          key: ${{ env.key-php5 }}

      - name: Setup cache environment 7.0 - 8.0
        if: matrix.php-version >= '7.0'
        id: cache-env-php7
        uses: shivammathur/cache-extensions@v1
        with:
          php-version: ${{ matrix.php-version }}
          extensions: ${{ env.extensions-php7 }}
          key: ${{ env.key-php7 }}

      - name: Cache extensions 5.3 - 5.6
        if: matrix.php-version < '7.0'
        uses: actions/cache@v1
        with:
          path: ${{ steps.cache-env-php5.outputs.dir }}
          key: ${{ steps.cache-env-php5.outputs.key }}
          restore-keys: ${{ steps.cache-env-php5.outputs.key }}

      - name: Cache extensions 7.0 - 8.0
        if: matrix.php-version >= '7.0'
        uses: actions/cache@v1
        with:
          path: ${{ steps.cache-env-php7.outputs.dir }}
          key: ${{ steps.cache-env-php7.outputs.key }}
          restore-keys: ${{ steps.cache-env-php7.outputs.key }}

      - name: Install PHP with extensions 5.3 - 5.6
        if: matrix.php-version < '7.0'
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php-version }}
          extensions: ${{ env.extensions-php5 }}
          ini-values: date.timezone='UTC'
          coverage: xdebug
          tools: composer:v1, pecl

      - name: Install PHP with extensions 7.0 - 8.0
        if: matrix.php-version >= '7.0'
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php-version }}
          extensions: ${{ env.extensions-php7 }}
          ini-values: date.timezone='UTC'
          coverage: xdebug
          tools: composer:v1, pecl

      - name: Install php-sqlsrv
        if: matrix.php == '7.4' || matrix.php == '7.3' || matrix.php == '7.2'
        run: |
          curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - >/dev/null 2>&1
          curl -sSL https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list | sudo tee /etc/apt/sources.list.d/mssql-server-2017.list >/dev/null 2>&1
          printf "\033[32;1m✓ \033[0m\033[90;1madd microsoft keys & repository\n"
          sudo apt-get -q update >/dev/null 2>&1
          printf "\033[32;1m✓ \033[0m\033[90;1mapt-get update\n"
          sudo pecl -q install pdo_sqlsrv > /dev/null 2>&1
          printf "\033[32;1m✓ \033[0m\033[90;1mpecl install pdo_sqlsrv\n"
          if (php -m | grep -i -q -w "pdo_sqlsrv"); then
              printf "\033[32;1mpdo_sqlsrv installed correct\n"
          else
              printf "\033[31;1mpdo_sqlsrv not installed :-(\n"
          fi

      - name: Determine composer cache directory on Linux
        run: echo "::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)"

      - name: Cache dependencies installed with composer
        uses: actions/cache@v1
        with:
          path: ${{ env.COMPOSER_CACHE_DIR }}
          key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
          restore-keys: |
            php${{ matrix.php-version }}-composer-
{'fraction_non_alphanumeric': 0.1379382086757516, 'fraction_numerical': 0.03547279725371892, 'mean_word_length': 1.742156303479749, 'pattern_counts': {'":': 2, '<': 17, '<?xml version=': 0, '>': 25, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2198588', 'n_tokens_mistral': 3399, 'n_tokens_neox': 3185, 'n_words': 665}