Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 4, 2025

Adds Codacy code coverage reporting to the GitHub Actions CI pipeline using simplecov-cobertura for Cobertura XML format generation.

Changes

  • twiglet.gemspec: Added simplecov-cobertura (> 1.4) and rexml (> 3.3.6) dependencies
  • test/test_coverage.rb: Configured CoberturaFormatter for CI builds to generate coverage/coverage.xml
  • .github/workflows/ruby.yml:
    • Added CODACY_PROJECT_NAME: twiglet-ruby env var
    • Added Codacy upload step (Ruby 3.4 only, continue-on-error: true)
    • Uses CODACY_PROJECT_TOKEN secret

Usage

Coverage uploads automatically on push when tests complete:

- name: Upload coverage to Codacy
  if: matrix.ruby-version == '3.4'
  continue-on-error: true
  env:
    CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
  run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage/coverage.xml

Note: rexml pinned to ~> 3.3.6 to avoid DoS vulnerability in earlier versions while maintaining compatibility with simplecov-cobertura.

Original prompt

Can you add Codacy Code Coverage reporting to this repo in the Semaphore CI pilpeline. You will need to add simplecov with loc reporting and use the codacy secret in the pipeline.
Need the following CODACY_PROJECT_NAME to be set to the repo name of know and the command to push the coverage is bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage/coverage.xml
Gem to use is simplecov-cobertura


💡 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.

Copilot AI and others added 3 commits December 4, 2025 17:12
Co-authored-by: addersuk <131964+addersuk@users.noreply.github.com>
Co-authored-by: addersuk <131964+addersuk@users.noreply.github.com>
Co-authored-by: addersuk <131964+addersuk@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Codacy code coverage reporting to Semaphore CI Add Codacy code coverage reporting with simplecov-cobertura Dec 4, 2025
Copilot AI requested a review from addersuk December 4, 2025 17:21
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