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 badges and a workflow for coverage #7

Merged
merged 1 commit into from
May 4, 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
10 changes: 10 additions & 0 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,13 @@ jobs:

- run: |
make test

- name: Update coverage report
uses: ncruces/go-coverage-report@v0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: It's recommended to use a specific version of the GitHub Action rather than the default branch or a zero major version. This practice ensures that your workflows are not broken by changes made in newer versions of the Action. [best practice]

Suggested change
uses: ncruces/go-coverage-report@v0
uses: ncruces/go-coverage-report@v1.0.0 # Replace with the latest stable version

with:
coverage-file: cover.out
report: true
chart: false
amend: false
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
Comment on lines +43 to +48
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: The condition for running the coverage report step seems to be intended only for pushes to the main branch. However, the syntax used in the 'if' condition might not work as expected because it's inside the 'with' block. It should be moved outside to the step level. [bug]

Suggested change
with:
coverage-file: cover.out
report: true
chart: false
amend: false
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
coverage-file: cover.out
report: true
chart: false
amend: false

continue-on-error: true
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Consider setting 'continue-on-error' to false for critical steps such as coverage reporting unless it's explicitly acceptable for these steps to fail without failing the entire workflow. This ensures that any issues with the coverage reporting are addressed promptly. [best practice]

Suggested change
continue-on-error: true
continue-on-error: false

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
[comment]: # " Copyright Contributors to the Open Cluster Management project "
[![License](https://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
[![Go Report Card](https://goreportcard.com/badge/github.com/JustinKuli/governance-policy-nucleus)](https://goreportcard.com/report/github.com/JustinKuli/governance-policy-nucleus)
[![Go Reference](https://pkg.go.dev/badge/image)](https://pkg.go.dev/github.com/JustinKuli/governance-policy-nucleus)
[![Go Coverage](https://github.com/JustinKuli/governance-policy-nucleus/wiki/coverage.svg)](https://raw.githack.com/wiki/JustinKuli/governance-policy-nucleus/coverage.html)

# Governance Policy Nucleus

Open Cluster Management - Governance Policy Nucleus

[![License](https://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)

## Description

The Policy Nucleus maintains common API validation, structs, and methods for policy controllers.
Expand Down