-
Notifications
You must be signed in to change notification settings - Fork 42
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] Update golangci linter step to avoid timeout #1082
Conversation
This pull request does not have a backport label. Could you fix it @uri-weisman? 🙏
|
📊 Allure Report - 💚 No failures were reported.
|
.github/workflows/unit-test.yml
Outdated
@@ -122,7 +122,9 @@ jobs: | |||
uses: golangci/[email protected] | |||
with: | |||
version: latest | |||
args: --timeout=10m --whole-files | |||
args: --timeout=10m --whole-files -v | |||
skip-pkg-cache: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this disable caching?
We might want to instead try running this job with the official instructions which claim that caching is enabled by default:
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added skip-pkg-cache
to address a similar issue to this one.
I'll try your suggested setup as well, however, I'm still experimenting so I'll make it a draft pr.
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: .go-version | ||
cache: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this would remove the caching, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caching is supposed to be handled in https://github.com/golangci/golangci-lint-action
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, they mention it in the performance section:
https://github.com/golangci/golangci-lint-action#performance
According to the logs, it seems that cache is being used by the linter:
Restored cache for golangci-lint from key 'golangci-lint.cache-2790-1b6dbac67386be50dbf356cfb1597004c1acd945' in 53191ms
As evidence, the linter run was very fast (~32s) compared to the past.
Summary of your changes
Multiple builds are failing due to golangci linter timeout, instead of increasing the timeout let's try and add cache to the linter step, it might reduce the execution time.
Checklist