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

Support install-mode: none #1049

Closed
2 tasks done
jlevesy opened this issue May 28, 2024 · 6 comments · Fixed by #1079
Closed
2 tasks done

Support install-mode: none #1049

jlevesy opened this issue May 28, 2024 · 6 comments · Fixed by #1079
Labels
enhancement New feature or request

Comments

@jlevesy
Copy link

jlevesy commented May 28, 2024

Welcome

  • Yes, I understand that the GitHub action repository is not the repository of golangci-lint itself.
  • Yes, I've searched similar issues on GitHub and didn't find any.

Your feature request related to a problem? Please describe.

Hey,

I'm exploring the idea of using a project level package manager (https://www.jetify.com/devbox/) for our tooling and we would like for it to handle the installation of golangci-lint in our CI.

That being said, the action offers some nice caching capabilities and feedback features that we would still be happy to keep using.

But we can't really do that with the current golangci-lint apparently,

Describe the solution you'd like.

Would it make sense to add a third value (None) to the install mode enum, that would only lookup in the system where golangci-lint is being installed?

Describe alternatives you've considered.

Not using the golangci-lint action :(.

Additional context.

No response

@Zxilly
Copy link

Zxilly commented Jul 3, 2024

go1.23 support is currently available at https://github.com/ldez/golangci-lint/tree/feat/go1.23, but due to limitations of goinstall, it must be manually git cloned and then go install. Adding the none installation option allows users to perform this step themselves and still benefit from the cache mechanism provided by this action.

@ldez
Copy link
Member

ldez commented Jul 29, 2024

I wonder if the fact of looking for the binary inside the PATH should be a hard restriction or if the action should allow to define a path to a binary.
Cleary, using the PATH is easier.
I'm still thinking 🤔

@ldez
Copy link
Member

ldez commented Jul 29, 2024

@jlevesy what is exactly the problem with the current installation of golangci-lint binary?
Are you using a custom golangci-lint version?
Is there a problem with the binary download?
Is it related to custom linters?

@jlevesy
Copy link
Author

jlevesy commented Jul 29, 2024

Are you using a custom golangci-lint version?

No.

Is there a problem with the binary download?

Yes. I'm looking into the possibility of using something else (devbox) to install golangci-lint in the workflow.

Is it related to custom linters?

No.

What is exactly the problem with the current installation of golangci-lint binary?

With the following devbox.json file at the root of my repository

{
    "packages": [
        "go@1.22",
        "golangci-lint@1.59"
    ]
}

Then I can have the following CI workflow defined with the described behavior:

name: CI
on: [pull_request]
jobs:
  ci:
    name: CI
    runs-on: ubuntu-22.04
    steps:
      - name: Checks out the code
        uses: actions/checkout@v3
      - name: Install devbox
        uses: jetify-com/devbox-install-action@v0.10.0 # <- installs go and golangci-lint, makes them available into the path
      - name: Run Linter
        uses: golangci/golangci-lint-action@v6 # <- runs golangci-lint, using the version available from the path.
        with:
           install-mode: none

@Zxilly
Copy link

Zxilly commented Jul 29, 2024

Maybe we can use install-mode: path/current? Find the golangci-lint in the current path, and throw error if we can't find it.

@ldez ldez added enhancement New feature or request and removed proposal labels Jul 29, 2024
@jlevesy
Copy link
Author

jlevesy commented Jul 30, 2024

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants