Why the execution of golangci-lint takes so much time
See original GitHub issueIn the documentation, it says the execution of golangci-lint could take 1s or 35s without cache, but in my project, I am getting a bigger time to execute the command. For example, I had a run that took 110629ms, and it is a small project. In my machine normally took 4s (based on the output of the time command) In the GitHub action I am using the same setup we have in the documentation
Job definition
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.29
args: --timeout 3m0s
Job output
Run golangci/golangci-lint-action@v2
prepare environment
go env
Installed Go in 230ms
Requested golangci-lint 'v1.29', using 'v1.29.0', calculation took 261ms
Installing golangci-lint v1.29.0...
Downloading https://github.com/golangci/golangci-lint/releases/download/v1.29.0/golangci-lint-1.29.0-linux-amd64.tar.gz ...
Cache not found for input keys: golangci-lint.cache-2690-bc8b7dd79789a0f804ae3b455ac3675f98516b1a, golangci-lint.cache-2690-, golangci-lint.cache-
/usr/bin/tar xz --overwrite --warning=no-unknown-keyword -C /home/runner -f /home/runner/work/_temp/2680cbd8-7cef-4ae9-b3f8-76eda97557b9
Installed golangci-lint into /home/runner/golangci-lint-1.29.0-linux-amd64/golangci-lint in 693ms
Prepared env in 957ms
run golangci-lint
Running [/home/runner/golangci-lint-1.29.0-linux-amd64/golangci-lint run --out-format=github-actions --timeout 3m0s] in [] ...
golangci-lint found no issues
Ran golangci-lint in 110629ms
Local machine output
time golangci-lint run --out-format=github-actions --timeout 3m0s
golangci-lint run --out-format=github-actions --timeout 3m0s 4.34s user 5.27s system 399% cpu 2.404 total
Issue Analytics
- State:
- Created 2 years ago
- Reactions:16
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Performance | golangci-lint
We schedule linters by a special algorithm which takes estimated execution time into account. It allows to save 10-30% of time when one...
Read more >golangci-lint: Linters Runner for Go. ...
It takes 300-1000 ms for $GOROOT/src . Smart linters scheduling. We schedule linters by a special algorithm which takes estimated execution time into...
Read more >golangci
Why the execution of golangci-lint takes so much time $ 0. Created 1 year ago in golangci/golangci-lint-action with 1 comments. In the documentation,...
Read more >Can't install golangci-lint locally
If golang-ci has properly been installed, the issue is most likely that the installation directory is not in your PATH environment variable.
Read more >fast & configurable linter for Go - revive
Revive provides more rules compared to golint . Who uses Revive ... Note that while revive configuration is in TOML, that of golangci-lint...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just add more info if helps. 😃
My golangci-lint action recently 50% time failed because of timeout issue since a week ago. Mine is a small project too at this moment.
Below are two pull requests which is not related to with Go part (defined in
working-directory
) at all:Here is when it is normal https://github.com/Hongbo-Miao/hongbomiao.com/runs/3297080244?check_suite_focus=true
And here is when it is slow https://github.com/Hongbo-Miao/hongbomiao.com/runs/3298464932?check_suite_focus=true
As you see, both runs happen recently, however, when golangci-lint is slow, it can take a very long time.
We are also increasingly seeing this behaviour in our builds. Is there anything I can do to help?