Set up Code Climate with GitHub Actions


The Code Climate API has been disabled on July 18th, 2025.

Any attempts to upload coverage to the Code Climate API (via the cc-test-reporter) will result in failed CI builds.

To avoid disruption, you must remove (or comment out) any remaining references to the old cc-test-reporter within your CI scripts.

See the migration guide.

This post goes over how to set up Code Climate test reporter with GitHub Actions.

Prerequisites

Given you have a workflow .github/workflows/test.yml:

# .github/workflows/test.yml
name: test
on: push
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      # ...

Setup

Use remarkablemark/setup-codeclimate:

steps:
  - uses: remarkablemark/setup-codeclimate@v2

Assuming your test command is npm test:

steps:
  - uses: remarkablemark/setup-codeclimate@v2
  - run: |
      cc-test-reporter before-build
      npm test
      cc-test-reporter after-build --exit-code $?
    env:
      CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}

Example

Full example of .github/workflows/test.yml:

# .github/workflows/test.yml
name: test
on: push
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: remarkablemark/setup-codeclimate@v2
      - run: |
          cc-test-reporter before-build
          npm test
          cc-test-reporter after-build --exit-code $?
        env:
          CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}

For more options, check out the readme or examples.



Please support this site and join our Discord!