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/gha: convert lint-extra from a job to a step #3457

Merged
merged 1 commit into from
Apr 14, 2022

Conversation

kolyshkin
Copy link
Contributor

There is no need to parallelize lint and lint-extra jobs,
and they only differ with the arguments to golangci-lint.
Given that the longest time spent in these jobs is installing
libseccomp-dev, and that the second linter run can probably
benefit a lot from caching, it makes sense to merge them.

Move lint-extra from a separate job to a step in lint job.

@kolyshkin
Copy link
Contributor Author

kolyshkin commented Apr 12, 2022

OK it's working, except that golangci-lint is installed twice. Filed an issue about it: golangci/golangci-lint-action#449

That issue does not prevent this PR from merging.

@kolyshkin kolyshkin marked this pull request as draft April 13, 2022 05:25
@kolyshkin kolyshkin force-pushed the ci-merge-lint-extra branch 8 times, most recently from 03f4ae1 to dea7077 Compare April 14, 2022 03:15
There is no need to parallelize lint and lint-extra jobs,
and they only differ with the arguments to golangci-lint.
Given that the longest time spent in these jobs is installing
libseccomp-dev, and that the second linter run can probably
benefit a lot from caching, it makes sense to merge them.

Move lint-extra from a separate job to a step in lint job.

The implementation is motivated by [1] and relies on the fact
that the last commit being fetched is the merge commit. So,
we need to set fetch-depth to 2 to be able to see the diff of
the merge commit -- and this is what golangci-lint is using.

[1] golangci/golangci-lint-action#449 (comment)

Signed-off-by: Kir Kolyshkin <[email protected]>
@kolyshkin
Copy link
Contributor Author

OK, I redid it and it now works as expected. PTAL @thaJeztah @mrunalp

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@thaJeztah thaJeztah merged commit 238717d into opencontainers:main Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants