Skip to content

Why the execution of golangci-lint takes so much time #297

Closed
@Moser-ss

Description

@Moser-ss

In 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions