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

ci: publish static code analysis report to code climate #13

Merged
merged 4 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,31 @@ jobs:
with:
name: coverage-reports
path: report


publish-reports:
runs-on: ubuntu-latest
name: Publish coverage reports
needs: build-and-test

# Only publish coverage reports when building the main branch.
#
# This avoids exposing the secrets to attackers who debug print the
# secrets during the pull request verification build.
if: github.ref == 'refs/heads/main'

steps:
# the repository is required by codeclimate-action
- uses: actions/checkout@v4

- name: Download coverage reports
uses: actions/download-artifact@v4
with:
name: coverage-reports
path: coverage-reports

- name: Publish coverage report to CodeClimate
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: coverage-reports/lcov.info:lcov
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Save Energy

[![Maintainability](https://api.codeclimate.com/v1/badges/a73e183c51a4686a9969/maintainability)](https://codeclimate.com/github/wonderbird/save-energy/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/a73e183c51a4686a9969/test_coverage)](https://codeclimate.com/github/wonderbird/save-energy/test_coverage)

Reduce your carbon footprint by saving energy on GitHub.

## How we can save energy on GitHub
Expand Down