<commit_before>name: "CI"

on:
  pull_request:
  push:
    branches:
      - "master"
  schedule:
    - cron: "42 3 * * *"

jobs:
  phpunit:
    name: "PHPUnit"
    runs-on: "ubuntu-20.04"

    strategy:
      matrix:
        php-version:
          - "7.4"
          - "8.0"
          - "8.1"
        dependencies:
          - "highest"
        include:
          - dependencies: "lowest"
            php-version: "7.4"

    steps:
      - name: "Checkout"
        uses: actions/checkout@v3
        with:
          fetch-depth: 2

      - name: "Install PHP"
        uses: "shivammathur/setup-php@v2"
        with:
          php-version: "${{ matrix.php-version }}"
          coverage: "pcov"
          ini-values: "zend.assertions=1"

      - name: "Install dependencies with Composer"
        uses: "ramsey/composer-install@v2"
        with:
          dependency-versions: "${{ matrix.dependencies }}"
          composer-options: "${{ matrix.composer-options }}"

      - name: "Run PHPUnit"
        run: |
          export $ENV
          vendor/bin/phpunit --coverage-clover=coverage.xml

      - name: "Upload coverage file"
        uses: actions/upload-artifact@v3
        with:
          name: "phpunit-${{ matrix.deps }}-${{ matrix.php-version }}.coverage"
          path: "coverage.xml"

  upload_coverage:
    name: "Upload coverage to Codecov"
    runs-on: "ubuntu-20.04"
    needs:
      - "phpunit"

    steps:
      - name: "Checkout"
        uses: actions/checkout@v3
        with:
          fetch-depth: 2

      - name: "Download coverage files"
        uses: actions/download-artifact@v3
        with:
          path: "reports"

      - name: "Upload to Codecov"
        uses: "codecov/codecov-action@v2"
        with:
          directory: "reports"

  benchmarks:
    name: "Benchmarks"
    runs-on: "ubuntu-20.04"

    steps:
      - name: "Checkout"
        uses: actions/checkout@v3

      - name: "Install PHP"
        uses: "shivammathur/setup-php@v2"
        with:
          # Run on the lowest support version to ensure compatibility
          php-version: "7.4"
          coverage: "none"

      - name: "Install dependencies with Composer"
        uses: "ramsey/composer-install@v2"

      - name: "Run PHPBench"<commit_msg>Update codecov/codecov-action action to v3 (#1125)<commit_after>name: "CI"

on:
  pull_request:
  push:
    branches:
      - "master"
  schedule:
    - cron: "42 3 * * *"

jobs:
  phpunit:
    name: "PHPUnit"
    runs-on: "ubuntu-20.04"

    strategy:
      matrix:
        php-version:
          - "7.4"
          - "8.0"
          - "8.1"
        dependencies:
          - "highest"
        include:
          - dependencies: "lowest"
            php-version: "7.4"

    steps:
      - name: "Checkout"
        uses: actions/checkout@v3
        with:
          fetch-depth: 2

      - name: "Install PHP"
        uses: "shivammathur/setup-php@v2"
        with:
          php-version: "${{ matrix.php-version }}"
          coverage: "pcov"
          ini-values: "zend.assertions=1"

      - name: "Install dependencies with Composer"
        uses: "ramsey/composer-install@v2"
        with:
          dependency-versions: "${{ matrix.dependencies }}"
          composer-options: "${{ matrix.composer-options }}"

      - name: "Run PHPUnit"
        run: |
          export $ENV
          vendor/bin/phpunit --coverage-clover=coverage.xml

      - name: "Upload coverage file"
        uses: actions/upload-artifact@v3
        with:
          name: "phpunit-${{ matrix.deps }}-${{ matrix.php-version }}.coverage"
          path: "coverage.xml"

  upload_coverage:
    name: "Upload coverage to Codecov"
    runs-on: "ubuntu-20.04"
    needs:
      - "phpunit"

    steps:
      - name: "Checkout"
        uses: actions/checkout@v3
        with:
          fetch-depth: 2

      - name: "Download coverage files"
        uses: actions/download-artifact@v3
        with:
          path: "reports"

      - name: "Upload to Codecov"
        uses: codecov/codecov-action@v3
        with:
          directory: "reports"

  benchmarks:
    name: "Benchmarks"
    runs-on: "ubuntu-20.04"

    steps:
      - name: "Checkout"
        uses: actions/checkout@v3

      - name: "Install PHP"
        uses: "shivammathur/setup-php@v2"
        with:
          # Run on the lowest support version to ensure compatibility
          php-version: "7.4"
          coverage: "none"

      - name: "Install dependencies with Composer"
        uses: "ramsey/composer-install@v2"

      - name: "Run PHPBench"
{'fraction_non_alphanumeric': 0.12629490852986555, 'fraction_numerical': 0.017853206964954817, 'mean_word_length': 1.6947743467933492, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5866027', 'n_tokens_mistral': 1551, 'n_tokens_neox': 1466, 'n_words': 322}