Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Code Climate coverage report with gitauto model #44

Closed

Conversation

gitauto-ai[bot]
Copy link

@gitauto-ai gitauto-ai bot commented Jul 22, 2024

Original issue: #26

What is the feature

The feature is to add Code Climate coverage report integration to the project.

Why we need the feature

Integrating Code Climate coverage reports will help us maintain high code quality by providing insights into test coverage. This will allow us to identify untested parts of the codebase and ensure that our tests are comprehensive, ultimately leading to more robust and reliable software.

How to implement and why

  1. Update appveyor.yml:

    • Add the necessary configuration to upload coverage reports to Code Climate. This typically involves adding a script to run after tests that sends the coverage data to Code Climate.
    • Example:
      after_test:
        - ps: |
            $env:CODECLIMATE_REPO_TOKEN = 'your_code_climate_repo_token'
            Invoke-Expression (Invoke-WebRequest -Uri https://codeclimate.com/test_reports -UseBasicParsing).Content
  2. Modify .github/workflows:

    • Update existing workflows or create a new workflow to ensure that coverage reports are generated and uploaded during the CI process.
    • Example:
      name: Code Climate Coverage
      on: [push, pull_request]
      jobs:
        test:
          runs-on: ubuntu-latest
          steps:
            - uses: actions/checkout@v2
            - name: Set up .NET
              uses: actions/setup-dotnet@v1
              with:
                dotnet-version: '5.0.x'
            - name: Install dependencies
              run: dotnet restore
            - name: Run tests
              run: dotnet test --collect:"XPlat Code Coverage"
            - name: Upload coverage to Code Climate
              run: |
                curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
                chmod +x ./cc-test-reporter
                ./cc-test-reporter before-build
                ./cc-test-reporter format-coverage -t cobertura -o coverage/codeclimate.json
                ./cc-test-reporter upload-coverage
          env:
            CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
  3. Update Documentation:

    • Add instructions in the README.md or a dedicated documentation file on how to set up and use Code Climate coverage reports for new contributors.
    • Example:
      ## Code Climate Coverage Reports
      To enable Code Climate coverage reports, ensure you have the `CC_TEST_REPORTER_ID` secret set in your repository settings.

By following these steps, we ensure that our project is integrated with Code Climate for continuous monitoring of test coverage, which will help maintain and improve code quality over time.

Test these changes locally

git checkout -b gitauto/issue-#26-5bb6718d-3964-4fa1-a82c-40e79e927090
git pull origin gitauto/issue-#26-5bb6718d-3964-4fa1-a82c-40e79e927090

@gstraccini gstraccini bot requested a review from guibranco July 22, 2024 00:10
@gstraccini gstraccini bot added 🚦awaiting triage Awaiting triage 🤖 bot Issue/Pull request created by bot labels Jul 22, 2024
@AppVeyorBot
Copy link

Build holiday-api-rust 1.0.206 failed (commit 0ba6df51db by @gitauto-ai[bot])

@guibranco guibranco changed the title Fix [FEATURE] Add Code Climate coverage report with gitauto model Add Code Climate coverage report with gitauto model Aug 15, 2024
@AppVeyorBot
Copy link

Build holiday-api-rust 1.0.212 failed (commit 014dd428db by @gstraccini[bot])

@AppVeyorBot
Copy link

Build holiday-api-rust 1.0.217 failed (commit 43208b3447 by @gstraccini[bot])

@guibranco guibranco closed this Aug 28, 2024
@guibranco guibranco deleted the gitauto/issue-#26-5bb6718d-3964-4fa1-a82c-40e79e927090 branch August 28, 2024 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚦awaiting triage Awaiting triage 🤖 bot Issue/Pull request created by bot size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants