Skip to content

Migrate coverage reporting from Coveralls to Codecov#59

Merged
BenMorel merged 2 commits intomasterfrom
copilot/migrate-to-codecov
Feb 26, 2026
Merged

Migrate coverage reporting from Coveralls to Codecov#59
BenMorel merged 2 commits intomasterfrom
copilot/migrate-to-codecov

Conversation

Copy link
Contributor

Copilot AI commented Feb 26, 2026

Replaces Coveralls with Codecov for coverage reporting, switching from xdebug to pcov and removing the php-coveralls dependency.

Changes

  • .github/workflows/ci.yml — across all six PHPUnit jobs:

    • coverage: xdebugcoverage: pcov
    • Clover output simplified: build/logs/clover.xmlclover.xml (drops mkdir -p build/logs)
    • Replaced Coveralls upload step with Codecov action:
      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v5
        env:
          CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
  • README.md — Coveralls badge replaced with Codecov badge

  • composer.jsonphp-coveralls/php-coveralls removed from require-dev

Original prompt

Migrate from Coveralls to Codecov for coverage reporting, mirroring the changes made in brick/math#109.

Changes required

1. .github/workflows/ci.yml

This repo has multiple phpunit jobs (phpunit-mysql, phpunit-mariadb, phpunit-postgres, phpunit-sqlite, phpunit-geos, phpunit-geosop). In ALL of them, make the following changes:

  • Change coverage: xdebug to coverage: pcov in the Setup PHP step.

  • In the "Run PHPUnit with coverage" step, change the clover output path from build/logs/clover.xml to clover.xml (and remove the mkdir -p build/logs line):

    - name: Run PHPUnit with coverage
      run: vendor/bin/phpunit --coverage-clover clover.xml
      env:
        # keep any existing env vars (ENGINE, MYSQL_HOST, etc.)
  • Replace the "Upload coverage report to Coveralls" step with:

    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v5
      env:
        CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

    (No if: condition needed since these jobs always run coverage — remove the old step that runs vendor/bin/php-coveralls with COVERALLS_REPO_TOKEN.)

Here is the full current content of .github/workflows/ci.yml for reference:

name: CI

on:
  push:
  pull_request:

env:
  PSALM_PHP_VERSION: "8.4"
  COVERAGE_PHP_VERSION: "8.4"

jobs:
  psalm:
    name: Psalm
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ env.PSALM_PHP_VERSION }}
      - name: Install composer dependencies
        uses: ramsey/composer-install@v3
      - name: Run Psalm
        run: vendor/bin/psalm --show-info=false --no-progress

  coding-standard:
    name: Coding Standard
    uses: brick/coding-standard/.github/workflows/coding-standard.yml@v2
    with:
      working-directory: "tools/ecs"

  phpunit-mysql:
    name: PHPUnit MySQL
    runs-on: ubuntu-22.04
    strategy:
      fail-fast: false
      matrix:
        php-version:
          - "8.1"
          - "8.2"
          - "8.3"
          - "8.4"
        emulate-prepares:
          - "ON"
          - "OFF"
    services:
      mysql:
        image: "mysql:8.4"
        ports:
          - "3306:3306"
        options: >-
          --health-cmd "mysqladmin ping --silent"
        env:
          MYSQL_ROOT_PASSWORD: password
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php-version }}
          extensions: pdo_mysql
          coverage: xdebug
      - name: Install composer dependencies
        uses: ramsey/composer-install@v3
      - name: Run PHPUnit
        run: vendor/bin/phpunit
        env:
          ENGINE: pdo_mysql
          MYSQL_HOST: 127.0.0.1
          MYSQL_USER: root
          MYSQL_PASSWORD: password
          EMULATE_PREPARES: ${{ matrix.emulate-prepares }}
        if: ${{ matrix.php-version != env.COVERAGE_PHP_VERSION }}
      - name: Run PHPUnit with coverage
        run: |
          mkdir -p build/logs
          vendor/bin/phpunit --coverage-clover build/logs/clover.xml
        env:
          ENGINE: pdo_mysql
          MYSQL_HOST: 127.0.0.1
          MYSQL_USER: root
          MYSQL_PASSWORD: password
          EMULATE_PREPARES: ${{ matrix.emulate-prepares }}
        if: ${{ matrix.php-version == env.COVERAGE_PHP_VERSION }}
      - name: Upload coverage report to Coveralls
        run: vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
        env:
          COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        if: ${{ matrix.php-version == env.COVERAGE_PHP_VERSION }}

  phpunit-mariadb:
    name: PHPUnit MariaDB
    runs-on: ubuntu-22.04
    strategy:
      fail-fast: false
      matrix:
        php-version:
          - "8.1"
        emulate-prepares:
          - "ON"
          - "OFF"
    services:
      mariadb:
        image: "mariadb:11.4"
        env:
          MARIADB_ROOT_PASSWORD: password
        options: >-
          --health-cmd "mariadb-admin ping --silent --user=root --password=password"
        ports:
          - "3306:3306"
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php-version }}
          extensions: pdo_mysql
          coverage: xdebug
      - name: Install composer dependencies
        uses: ramsey/composer-install@v3
      - name: Run PHPUnit with coverage
        run: |
          mkdir -p build/logs
          vendor/bin/phpunit --coverage-clover build/logs/clover.xml
        env:
          ENGINE: pdo_mysql
          MYSQL_HOST: 127.0.0.1
          MYSQL_USER: root
          MYSQL_PASSWORD: password
          EMULATE_PREPARES: ${{ matrix.emulate-prepares }}
      - name: Upload coverage report to ...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

*This pull request was created from Copilot chat.*
>

<!-- START COPILOT CODING AGENT TIPS -->
---

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. [Learn more about Advanced Security.](https://gh.io/cca-advanced-security)

Co-authored-by: BenMorel <1952838+BenMorel@users.noreply.github.com>
Copilot AI changed the title [WIP] Migrate from Coveralls to Codecov for coverage reporting Migrate coverage reporting from Coveralls to Codecov Feb 26, 2026
@BenMorel BenMorel marked this pull request as ready for review February 26, 2026 23:33
@BenMorel BenMorel merged commit bff5391 into master Feb 26, 2026
32 checks passed
@codecov
Copy link

codecov bot commented Feb 27, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants