guibranco / guibranco/MSBuild.Version.Target

[FEATURE] Add CodeClimate coverage report

Open
#10 1 comment 1 reaction 0 assignees View on GitHub
♻️ code quality CI enhancement gitauto github_actions good first issue help wanted
Dominant language
PowerShell
Stars
5
Forks
1
PR merge metrics
No merged PRs in 30d

Description

**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](https://github.com/GuilhermeStracini/apiclient-boilerplate-dotnet/blob/main/appveyor.yml). We need to update this configuration to include Code Climate coverage reporting.

**Resources**
- [AppVeyor.yml](https://github.com/GuilhermeStracini/apiclient-boilerplate-dotnet/blob/main/appveyor.yml)
- [Code Climate Coverage Reporter Documentation](https://docs.codeclimate.com/docs/configuring-test-coverage)
- [Code Climate Settings](https://codeclimate.com/repos/641f0808f0db3866f9d68672/settings/test_reporter)

**Acceptance Criteria**
- Code Climate should be integrated into our build process.
- Coverage reports should be sent to Code Climate after each build.
- The setup should be documented in the repository.

**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:

```yaml
# 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=" -H "Authorization: Token "
```

Replace `` and `` 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.