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

Github Action should use the same lint command as local #71

Closed
wants to merge 1 commit into from

Conversation

alok87
Copy link

@alok87 alok87 commented Aug 26, 2022

Fixes #69

The nice thing of having a make lint is it runs tasks in docker container that works in any environment. We do not need to maintain multiple lint settings in multiple files and we can reuse the same make lint.

Copy link
Owner

@thockin thockin left a comment

Choose a reason for hiding this comment

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

Now I recall why this is done this way - Is it allowed to run docker run from within a GH action?

-E unused
-E varcheck
- name: Lint code
run: make lint
Copy link
Owner

Choose a reason for hiding this comment

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

wants a trailing newline

steps:
- name: Install Go
Copy link
Owner

Choose a reason for hiding this comment

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

super minor, but your editor indents list items and mine doesn't. Can you make it the same whitespace as test.yaml, please?

@thockin
Copy link
Owner

thockin commented Aug 27, 2022

There's not much point in doing the matrix of versions once we are using a docker image, it will always use the same Go version, right?

@thockin thockin force-pushed the master branch 7 times, most recently from 02a976e to 72d5128 Compare August 27, 2022 20:56
@thockin
Copy link
Owner

thockin commented Aug 27, 2022

I changed the test and crossbuild actions to use make - look at those?

runs-on: ubuntu-latest
strategy:
matrix:
go-versions: [ 1.16.x, 1.17.x, 1.18.x, 1.19.x ]
Copy link
Owner

Choose a reason for hiding this comment

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

For lint, you can get rid of this axis in the matrix, and remove the "install" step

strategy:
matrix:
go-versions: [ 1.16.x, 1.17.x, 1.18.x, 1.19.x ]
platform: [ ubuntu-latest, windows-latest ]
Copy link
Owner

Choose a reason for hiding this comment

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

let's remove Windows - it doesn't practically work

@thockin
Copy link
Owner

thockin commented Aug 27, 2022

To convince myself, I ended up just making the change myself, sorry.

@alok87
Copy link
Author

alok87 commented Aug 28, 2022

Yes, docker is installed in the ubuntu latest ones and we can use it in GH https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2004-Readme.md#tools

This also needs to be fixed #73

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.

golangci-lint issues
2 participants