docs/CODECOV_SETUP

Codecov Setup

To enable code coverage reporting in CI:

  1. Get a Codecov token:

    • Go to codecov.io
    • Sign in with your GitHub account
    • Add your repository
    • Copy the repository token
  2. Add the token to GitHub secrets:

    • Go to your repository on GitHub
    • Navigate to Settings → Secrets and variables → Actions
    • Click “New repository secret”
    • Name: CODECOV_TOKEN
    • Value: Paste your Codecov token
    • Click “Add secret”
  3. Coverage reports will be generated automatically:

    • The CI workflow runs tests with coverage enabled
    • Coverage reports are uploaded to Codecov on push events
    • Pull requests will show coverage information

Local Coverage

To generate coverage reports locally:

COVERAGE=true bundle exec rspec

This will generate:

  • HTML report at coverage/index.html
  • XML report at coverage/coverage.xml (for Codecov)