Skip to content

Migrate coverage reporting from Coveralls to Codecov#11

Merged
BenMorel merged 4 commits intomasterfrom
copilot/migrate-from-coveralls-to-codecov
Feb 27, 2026
Merged

Migrate coverage reporting from Coveralls to Codecov#11
BenMorel merged 4 commits intomasterfrom
copilot/migrate-from-coveralls-to-codecov

Conversation

Copy link
Contributor

Copilot AI commented Feb 26, 2026

  • Update .github/workflows/ci.yml: fix coverage step and replace Coveralls upload with Codecov action
  • Update README.md: replace Coveralls badge with Codecov badge (markdown syntax)
  • Update composer.json: remove php-coveralls/php-coveralls 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

In the phpunit job, make the following changes:

  • 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 and the mkdir -p mkdir -p build/logs bug):

    - name: Run PHPUnit with coverage
      run: vendor/bin/phpunit --coverage-clover clover.xml
      if: ${{ matrix.php-version == env.COVERAGE_PHP_VERSION }}
  • 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 }}
      if: ${{ matrix.php-version == env.COVERAGE_PHP_VERSION }}

    (Remove the old step that runs vendor/bin/php-coveralls with COVERALLS_REPO_TOKEN.)

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

name: CI

on:
  push:
  pull_request:

env:
  COVERAGE_PHP_VERSION: "8.3"

jobs:
  phpunit:
    name: PHPUnit
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        php-version:
          - "7.3"
          - "7.4"
          - "8.0"
          - "8.1"
          - "8.2"
          - "8.3"
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php-version }}
          coverage: xdebug
      - name: Install composer dependencies
        uses: ramsey/composer-install@v3
      - name: Run PHPUnit
        run: vendor/bin/phpunit
        if: ${{ matrix.php-version != env.COVERAGE_PHP_VERSION }}
      - name: Run PHPUnit with coverage
        run: |
          mkdir -p mkdir -p build/logs
          vendor/bin/phpunit --coverage-clover build/logs/clover.xml
        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 }}

2. README.md

Replace the Coveralls badge with a Codecov badge. Look for the Coveralls badge in the README.md and replace it with:

[![Coverage](https://codecov.io/github/brick/std/graph/badge.svg)](https://codecov.io/github/brick/std)

3. composer.json

Remove php-coveralls/php-coveralls from the require-dev section.

This pull request was created from Copilot chat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: BenMorel <1952838+BenMorel@users.noreply.github.com>
Copilot AI changed the title [WIP] Migrate coverage reporting from Coveralls to Codecov Migrate coverage reporting from Coveralls to Codecov Feb 26, 2026
@BenMorel
Copy link
Member

@copilot Don't use HTML in markdown.

Co-authored-by: BenMorel <1952838+BenMorel@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 27, 2026

@copilot Don't use HTML in markdown.

Fixed in 4eda4ff — the badge now uses standard markdown syntax: [![Coverage Status](https://codecov.io/github/brick/std/graph/badge.svg)](https://codecov.io/github/brick/std)

@BenMorel BenMorel marked this pull request as ready for review February 27, 2026 00:29
@BenMorel BenMorel merged commit 1139672 into master Feb 27, 2026
10 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