<commit_before>on: push
name: Qa workflow
jobs:
  setup:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Restore/cache vendor folder
      uses: actions/cache@v1
      with:
        path: vendor
        key: all-build-${{ hashFiles('**/composer.lock') }}
        restore-keys: |
          all-build-${{ hashFiles('**/composer.lock') }}
          all-build-
    - name: Restore/cache tools folder
      uses: actions/cache@v1
      with:
        path: tools
        key: all-tools-${{ github.sha }}
        restore-keys: |
          all-tools-${{ github.sha }}-
          all-tools-
    - name: composer
      uses: docker://composer
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        args: install --no-interaction --prefer-dist --optimize-autoloader
    - name: composer-require-checker
      uses: docker://phpga/composer-require-checker-ga
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        args: check --config-file ./composer-require-config.json composer.json
    - name: Install phive
      run: make install-phive
    - name: Install PHAR dependencies
      run: tools/phive.phar --no-progress install --copy --trust-gpg-keys 4AA394086372C20A,D2CCAC42F6295E7D,<KEY> --force-accept-unsigned

  phpunit-with-coverage:
    runs-on: ubuntu-latest
    name: Unit tests
    needs: setup
    steps:
    - uses: actions/checkout@master
    - name: Restore/cache vendor folder
      uses: actions/cache@v1
      with:
        path: vendor
        key: all-build-${{ hashFiles('**/composer.lock') }}
        restore-keys: |
          all-build-${{ hashFiles('**/composer.lock') }}
          all-build-
    - name: Restore/cache tools folder
      uses: actions/cache@v1
      with:
        path: tools
        key: all-tools-${{ github.sha }}
        restore-keys: |
          all-tools-${{ github.sha }}-
          all-tools-
    - name: Setup PHP
      uses: shivammathur/setup-php@master
      with:
        php-version: 7.2
        extension-csv: mbstring, intl, iconv, libxml, dom, json, simplexml, zlib
        ini-values-csv: memory_limit=2G, display_errors=On, error_reporting=-1
        coverage: xdebug
        pecl: false
    - name: Run PHPUnit
      run: php tools/phpunit.phar
#    - name: Upload to coveralls
#      env:
#        CI_NAME: Github Actions
#        CI_BUILD_NUMBER: $GITHUB_ACTION
#        CI_BUILD_URL: https://github.com/phpDocumentor/phpDocumentor/runs/$GITHUB_ACTION
#        CI_BRANCH: $GITHUB_REF
#      run: ./tools/php-coveralls --verbose
    - name: Upload to Scrutinizer
      run: tools/ocular code-coverage:upload --format=php-clover build/logs/clover.xml

  phpunit:
    runs-on: ${{ matrix.operating-system }}
    strategy:
      matrix:
        operating-system:
        - ubuntu-latest
        - windows-latest
        - macOS-latest
        php-versions: ['7.2', '7.3', '7.4']
    name: Unit tests for PHP version ${{ matrix.php-versions }} on ${{ matrix.operating-system }}
    needs:
    - setup
    - phpunit-with-coverage
    steps:
    - uses: actions/checkout@master
    - name: Restore/cache vendor folder
      uses: actions/cache@v1
      with:
        path: vendor
        key: all-build-${{ hashFiles('**/composer.lock') }}
        restore-keys: |
          all-build-${{ hashFiles('**/composer.lock') }}
          all-build-
    - name: Restore/cache tools folder
      uses: actions/cache@v1
      with:
        path: tools
        key: all-tools-${{ github.sha }}
        restore-keys: |
          all-tools-${{ github.sha }}-
          all-tools-
    - name: Setup PHP
      uses: shivammathur/setup-php@master
      with:
        php-version: ${{ matrix.php-versions }}
        extension-csv: mbstring, intl, iconv, libxml, dom, json, simplexml, zlib
        ini-values-csv: memory_limit=2G, display_errors=On, error_reporting=-1
        pecl: false
    - name: Run PHPUnit
      run: php tools/phpunit.phar

  behat:
    runs-on: ${{ matrix.operating-system }}
    strategy:
      matrix:
        operating-system: [ubuntu-latest, windows-latest, macOS-latest]
        php-versions: ['7.2', '7.3']
    name: Integration tests for PHP version ${{ matrix.php-versions }} on ${{ matrix.operating-system }}
    needs:
      - setup
      - phpunit
    steps:
      - uses: actions/checkout@master
      - name: Restore/cache vendor folder
        uses: actions/cache@v1
        with:
          path: vendor
          key: all-build-${{ hashFiles('**/composer.lock') }}
          restore-keys: |
            all-build-${{ hashFiles('**/composer.lock') }}
            all-build-
      - name: Setup PHP
        uses: shivammathur/setup-php@master
        with:
          php-version: ${{ matrix.php-versions }}
          extension-csv: mbstring, intl, iconv, libxml, dom, json, simplexml, zlib
          ini-values-csv: memory_limit=2G, display_errors=On, error_reporting=-1
          pecl: false
      - name: Run Behat
        run: tools/behat
        continue-on-error: true

  codestyle:
    runs-on: ubuntu-latest
    needs: [setup, phpunit]
    steps:
    - uses: actions/checkout@master
    - name: Restore/cache vendor folder
      uses: actions/cache@v1
      with:
        path: vendor
        key: all-build-${{ hashFiles('**/composer.lock') }}
        restore-keys: |
          all-build-${{ hashFiles('**/composer.lock') }}
          all-build-
    - name: Restore/cache tools folder
      uses: actions/cache@v1
      with:
        path: tools
        key: all-tools-${{ github.sha }}
        restore-keys: |
          all-tools-${{ github.sha }}-
          all-tools-
    - name: Code style check
      uses: docker://oskarstark/phpcs-ga
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        args: -d memory_limit=1024M

  phpstan:
    runs-on: ubuntu-latest
    needs: [setup, phpunit]
    steps:
    - uses: actions/checkout@master
    - name: Restore/cache vendor folder
      uses: actions/cache@v1
      with:
        path: vendor
        key: all-build-${{ hashFiles('**/composer.lock') }}
        restore-keys: |
          all-build-${{ hashFiles('**/composer.lock') }}
          all-build-
    - name: Restore/cache tools folder
      uses: actions/cache@v1
      with:
        path: tools
        key: all-tools-${{ github.sha }}
        restore-keys: |
          all-tools-${{ github.sha }}-
          all-tools-
    - name: PHPStan
      uses: docker://phpdoc/phpstan-ga:master
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        args: analyse src tests --level 3 --configuration phpstan.neon
<commit_msg>Github actions should also use our image for phpcs<commit_after>on: push
name: Qa workflow
jobs:
  setup:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Restore/cache vendor folder
      uses: actions/cache@v1
      with:
        path: vendor
        key: all-build-${{ hashFiles('**/composer.lock') }}
        restore-keys: |
          all-build-${{ hashFiles('**/composer.lock') }}
          all-build-
    - name: Restore/cache tools folder
      uses: actions/cache@v1
      with:
        path: tools
        key: all-tools-${{ github.sha }}
        restore-keys: |
          all-tools-${{ github.sha }}-
          all-tools-
    - name: composer
      uses: docker://composer
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        args: install --no-interaction --prefer-dist --optimize-autoloader
    - name: composer-require-checker
      uses: docker://phpga/composer-require-checker-ga
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        args: check --config-file ./composer-require-config.json composer.json
    - name: Install phive
      run: make install-phive
    - name: Install PHAR dependencies
      run: tools/phive.phar --no-progress install --copy --trust-gpg-keys 4AA394086372C20A,D2CCAC42F6295E7D,E82B2FB314E9906E --force-accept-unsigned

  phpunit-with-coverage:
    runs-on: ubuntu-latest
    name: Unit tests
    needs: setup
    steps:
    - uses: actions/checkout@master
    - name: Restore/cache vendor folder
      uses: actions/cache@v1
      with:
        path: vendor
        key: all-build-${{ hashFiles('**/composer.lock') }}
        restore-keys: |
          all-build-${{ hashFiles('**/composer.lock') }}
          all-build-
    - name: Restore/cache tools folder
      uses: actions/cache@v1
      with:
        path: tools
        key: all-tools-${{ github.sha }}
        restore-keys: |
          all-tools-${{ github.sha }}-
          all-tools-
    - name: Setup PHP
      uses: shivammathur/setup-php@master
      with:
        php-version: 7.2
        extension-csv: mbstring, intl, iconv, libxml, dom, json, simplexml, zlib
        ini-values-csv: memory_limit=2G, display_errors=On, error_reporting=-1
        coverage: xdebug
        pecl: false
    - name: Run PHPUnit
      run: php tools/phpunit.phar
#    - name: Upload to coveralls
#      env:
#        CI_NAME: Github Actions
#        CI_BUILD_NUMBER: $GITHUB_ACTION
#        CI_BUILD_URL: https://github.com/phpDocumentor/phpDocumentor/runs/$GITHUB_ACTION
#        CI_BRANCH: $GITHUB_REF
#      run: ./tools/php-coveralls --verbose
    - name: Upload to Scrutinizer
      run: tools/ocular code-coverage:upload --format=php-clover build/logs/clover.xml

  phpunit:
    runs-on: ${{ matrix.operating-system }}
    strategy:
      matrix:
        operating-system:
        - ubuntu-latest
        - windows-latest
        - macOS-latest
        php-versions: ['7.2', '7.3', '7.4']
    name: Unit tests for PHP version ${{ matrix.php-versions }} on ${{ matrix.operating-system }}
    needs:
    - setup
    - phpunit-with-coverage
    steps:
    - uses: actions/checkout@master
    - name: Restore/cache vendor folder
      uses: actions/cache@v1
      with:
        path: vendor
        key: all-build-${{ hashFiles('**/composer.lock') }}
        restore-keys: |
          all-build-${{ hashFiles('**/composer.lock') }}
          all-build-
    - name: Restore/cache tools folder
      uses: actions/cache@v1
      with:
        path: tools
        key: all-tools-${{ github.sha }}
        restore-keys: |
          all-tools-${{ github.sha }}-
          all-tools-
    - name: Setup PHP
      uses: shivammathur/setup-php@master
      with:
        php-version: ${{ matrix.php-versions }}
        extension-csv: mbstring, intl, iconv, libxml, dom, json, simplexml, zlib
        ini-values-csv: memory_limit=2G, display_errors=On, error_reporting=-1
        pecl: false
    - name: Run PHPUnit
      run: php tools/phpunit.phar

  behat:
    runs-on: ${{ matrix.operating-system }}
    strategy:
      matrix:
        operating-system: [ubuntu-latest, windows-latest, macOS-latest]
        php-versions: ['7.2', '7.3']
    name: Integration tests for PHP version ${{ matrix.php-versions }} on ${{ matrix.operating-system }}
    needs:
      - setup
      - phpunit
    steps:
      - uses: actions/checkout@master
      - name: Restore/cache vendor folder
        uses: actions/cache@v1
        with:
          path: vendor
          key: all-build-${{ hashFiles('**/composer.lock') }}
          restore-keys: |
            all-build-${{ hashFiles('**/composer.lock') }}
            all-build-
      - name: Setup PHP
        uses: shivammathur/setup-php@master
        with:
          php-version: ${{ matrix.php-versions }}
          extension-csv: mbstring, intl, iconv, libxml, dom, json, simplexml, zlib
          ini-values-csv: memory_limit=2G, display_errors=On, error_reporting=-1
          pecl: false
      - name: Run Behat
        run: tools/behat
        continue-on-error: true

  codestyle:
    runs-on: ubuntu-latest
    needs: [setup, phpunit]
    steps:
    - uses: actions/checkout@master
    - name: Restore/cache vendor folder
      uses: actions/cache@v1
      with:
        path: vendor
        key: all-build-${{ hashFiles('**/composer.lock') }}
        restore-keys: |
          all-build-${{ hashFiles('**/composer.lock') }}
          all-build-
    - name: Restore/cache tools folder
      uses: actions/cache@v1
      with:
        path: tools
        key: all-tools-${{ github.sha }}
        restore-keys: |
          all-tools-${{ github.sha }}-
          all-tools-
    - name: Code style check
      uses: phpdoc/phpcs-ga:master
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        args: -d memory_limit=1024M

  phpstan:
    runs-on: ubuntu-latest
    needs: [setup, phpunit]
    steps:
    - uses: actions/checkout@master
    - name: Restore/cache vendor folder
      uses: actions/cache@v1
      with:
        path: vendor
        key: all-build-${{ hashFiles('**/composer.lock') }}
        restore-keys: |
          all-build-${{ hashFiles('**/composer.lock') }}
          all-build-
    - name: Restore/cache tools folder
      uses: actions/cache@v1
      with:
        path: tools
        key: all-tools-${{ github.sha }}
        restore-keys: |
          all-tools-${{ github.sha }}-
          all-tools-
    - name: PHPStan
      uses: docker://phpdoc/phpstan-ga:master
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        args: analyse src tests --level 3 --configuration phpstan.neon

{'fraction_non_alphanumeric': 0.13123123123123123, 'fraction_numerical': 0.008858858858858858, 'mean_word_length': 1.984763611920233, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, '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': '6783508', 'n_tokens_mistral': 4406, 'n_tokens_neox': 4234, 'n_words': 930}