I'm building a Go project, and I'm using GitHub actions on every checkin.
The project is here: https://github.com/filecoin-project/bacalhau
When I run the project locally, it runs fine - e.g.:
❯ golangci-lint run
❯
But when I do the same command in GitHub Actions, I get warnings like I haven't vendored in the modules correctly (guessing).
Error: undeclared name: `libp2p` (typecheck)
Error: undeclared name: `libp2p` (typecheck)
Error: undeclared name: `libp2p` (typecheck)
Error: "github.com/libp2p/go-libp2p" imported but not used (typecheck)
Error: issues found
Even when I remove the linting, I get similar problems (it doesn't build properly - e.g. https://github.com/filecoin-project/bacalhau/runs/5313987141?check_suite_focus=true
The ONE time I logged in myself, via ssh, and executed the build manually (e.g. go build
) it failed with the same error, but this was solveable by just doing go mod vendor
, go mod tidy
inline. HOWEVER, this shouldn't be necessary, right? Because I've checked in a vendor directory?
What am I missing? Thanks!
I solved this by blowing away everything in my /vendor dir, and .gitignoring it. This forced GitHub actions to redownload everything. Not sure if this was the most efficient solution, but worked for me!