forked from Boeing/config-file-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(goreportcard): Add step for goreportcard check
Go report card for repo: https://goreportcard.com/report/github.com/Boeing/config-file-validator Fixes Boeing#120 Signed-off-by: Bhargav Ravuri <[email protected]>
- Loading branch information
1 parent
c8df506
commit 09082ee
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Go Report Card | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
goreportcard: | ||
strategy: | ||
matrix: | ||
go: ['stable'] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Setup Go ${{ matrix.go-version }} | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
cache: false | ||
- name: Checkout gojp/goreportcard repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: gojp/goreportcard | ||
path: goreportcard | ||
- name: Install goreportcard-cli | ||
# goreportcard-cli requires the following linters: | ||
# 1. gometalinter | ||
# 2. golint | ||
# 3. gocyclo | ||
# 4. ineffassign | ||
# 5. misspell | ||
# among which, the linter gometalinter is deprecated. However, goreportcard repo has a vendor version of it. | ||
# Hence installing from the repo instead of `go install`. Refer https://github.com/gojp/goreportcard/issues/301 | ||
run: | | ||
cd goreportcard | ||
# Install prerequisite linter binaries: gometalinter, golint, gocyclo, ineffassign & misspell | ||
# Refer: https://github.com/gojp/goreportcard?tab=readme-ov-file#command-line-interface | ||
make install | ||
# Install goreportcard-cli binary | ||
go install ./cmd/goreportcard-cli | ||
which goreportcard-cli | ||
- name: Checkout Boeing/config-file-validator repo | ||
uses: actions/checkout@v4 | ||
- name: Run goreportcard | ||
run: | | ||
# Failure threshold is set to 100% to fail at any errors. Default is 75%. | ||
goreportcard-cli -t 100 |