Closed bradleygore closed 2 years ago
I also tried running on this agent: macos-12
and same output 😢
One thing I'm seeing is that it seems to not like dot imports - which I heavily use in tests. So, like where it errors about
2022-07-28T20:42:26.8920580Z ##[error]undeclared name: `MockConnection` (typecheck)
the MockConnection
is a mock generated by mockgen
and pkg is imported as . "pos-api/internal/websocket/mocks
Could there be something causing the linter to handle this setup different in the GH Action vs locally or even in Jenkins CI env?
@bradleygore What happens if change command in Makefile
to cd .. && golangci-lint run
?
Hi @maratori - thanks for the reply! If I just cd to root and do golangci-lint run -v --timeout 3m
I get the same output as I previously did locally. I think it has something to do with the dot imports when running in GH Action, based on the output errors.
@maratori - I decided to take a step back and walk before running and just try to go build
the project in the GH Action. Turns out, there was a private dependency I had forgotten about and had to set up 😲 Now the linter action is working perfectly after I addressed this - so it was totally my problem 😅 Sorry to bother - have a great weekend 😄
Thanks for this great GH Action! I'm excited to start using it!
Description
However, I'm running into an issue in that I get wildly different lint output from GH Action than I do local, on exact same version of
golangci-lint
.golangci-lint version
Locally:
golangci-lint has version 1.47.2 built from 61673b34 on 2022-07-21T10:53:45Z
GH Action Logs:
Repository Structure
As you can see,
.golangci.yml
file is at the root of the directory.Inside of
cmd
dir I haveMakefile
which is where I run the linter from likegolangci-lint -v ../...
, and I can see in the output that it picks up my config file due toverbose
output in both local run and in GH Action run:Local:
INFO [config_reader] Used config file ../.golangci.yml
GH Action:2022-07-28T19:53:22.1838177Z level=info msg="[config_reader] Used config file .golangci.yml"
I'm getting many lint issues in the GH Action that I do not get locally, so I'm curious what could be the culprit.
Locally, I'm running on macOS Monterey v 12.4 and also run the same in a Jenkins environment using Linux (trying to get away from Jenkins to just use GH Actions). I get the same output on both of those, which is no issues:
But in GH Action I get this:
Config Files
Workflow Yaml
.golangci.yml
Any thoughts or suggestions to try?