guibranco / holiday-api-rust

:calendar: :gear: Holiday API Rust SDK (API Client)
https://guibranco.github.io/holiday-api-rust/
MIT License
3 stars 1 forks source link

[FEATURE] Add CodeClimate coverage report #26

Open guibranco opened 1 year ago

guibranco commented 1 year ago

Description
We need to integrate Code Climate into our CI/CD pipeline to generate coverage reports for our project. This integration will help us maintain code quality and provide insights into our test coverage over time.

Context
The current configuration for our AppVeyor build can be found here. We need to update this configuration to include Code Climate coverage reporting.

Resources

Acceptance Criteria

Proposed Solution

  1. Create a Code Climate Token
    Sign up or log in to Code Climate, create a new repository, and obtain your repository token.

  2. Update AppVeyor Configuration
    Modify the appveyor.yml file to include the necessary steps for Code Climate integration. Below is a sample configuration snippet:

    # appveyor.yml
    version: '{build}'
    configuration: Release
    platform:
     - x64
    
    before_build:
     - nuget restore
    
    build_script:
     - msbuild /p:Configuration=Release
    
    after_test:
     - dotnet tool install --global dotnet-reportgenerator-globaltool
     - reportgenerator -reports:./Tests/coverage.cobertura.xml -targetdir:./Tests/coverage-report -reporttypes:Html
     - curl -X POST -H "Content-Type: application/json" -d "{\"data\":{\"attributes\":{\"branch\":\"$APPVEYOR_REPO_BRANCH\",\"commit\":\"$APPVEYOR_REPO_COMMIT\",\"coverage\":\"$(cat ./Tests/coverage-report/coverage.cobertura.xml)\"}}}" "https://api.codeclimate.com/v1/test_reports?project_id=<your_project_id>" -H "Authorization: Token <your_code_climate_token>"

    Replace <your_project_id> and <your_code_climate_token> with your actual Code Climate project ID and token.

  3. Install Required Tools
    Ensure that the dotnet-reportgenerator-globaltool is installed to generate the coverage reports.

  4. Verify Integration
    Push your changes and verify that the Code Climate coverage report is correctly uploaded after each build.

Additional Context
Make sure you have your Code Climate project set up and that you have the necessary permissions to push coverage reports. This integration will enable continuous monitoring of our code quality.

gitauto-ai[bot] commented 3 months ago

@guibranco Pull request completed! Check it out here https://github.com/guibranco/holiday-api-rust/pull/44 🚀

Note: I automatically create a pull request for an unassigned and open issue in order from oldest to newest once a day at 00:00 UTC, as long as you have remaining automation usage. Should you have any questions or wish to change settings or limits, please feel free to contact info@gitauto.ai or invite us to Slack Connect.