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

Replaces Travis with Github Action #465

Merged
merged 6 commits into from
Jul 8, 2022
Merged

Replaces Travis with Github Action #465

merged 6 commits into from
Jul 8, 2022

Conversation

nkcr
Copy link
Contributor

@nkcr nkcr commented Jul 7, 2022

  • updates the Makefile
  • applies gofmt and go mod tidy
  • staticcheck is commented out because there are a lot to fix

@nkcr nkcr self-assigned this Jul 7, 2022
@nkcr nkcr requested review from ineiti and jbsv July 7, 2022 15:54
Copy link
Member

@ineiti ineiti left a comment

Choose a reason for hiding this comment

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

Nice - some small comments, but else looks good.

name: Go lint

on:
push:
Copy link
Member

Choose a reason for hiding this comment

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

We don't use the push entry here, but rather protect the repository against direct pushes to master (which should be renamed to main :) and only allow merges when the tests pass.

This avoids running an unnecessary lint when you merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe redundant in some cases, but it doesn't hurt. I feel safer having a second check :)

run: make lint

- name: Vet
run: make vet
Copy link
Member

Choose a reason for hiding this comment

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

Add newline

name: Go test

on:
push:
Copy link
Member

Choose a reason for hiding this comment

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

same as above - you can remove push if the repo is configured accordingly.

steps:
- uses: shogo82148/actions-goveralls@v1
with:
parallel-finished: true
Copy link
Member

Choose a reason for hiding this comment

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

missing newline

# Coding style static check.
@go install honnef.co/go/tools/cmd/staticcheck@latest
@go mod tidy
#staticcheck `go list ./...`
Copy link
Member

Choose a reason for hiding this comment

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

Do you want to put the staticcheck in its own target? That would make more sense, IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer having one target that gathers all vetting scripts. Except if there is a case where we need to launch staticcheck but not the other linting tools.

Makefile Outdated
# target to run all the possible checks; it's a good habit to run it before
# pushing code
check: lint vet
go test ./...
Copy link
Member

Choose a reason for hiding this comment

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

missing newline

@sonarcloud
Copy link

sonarcloud bot commented Jul 8, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@nkcr nkcr merged commit 353dbb4 into master Jul 8, 2022
@nkcr nkcr deleted the test-fix branch July 8, 2022 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants